diff options
Diffstat (limited to 'plugins/web-search/web-search.plugin.zsh')
-rw-r--r-- | plugins/web-search/web-search.plugin.zsh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 572427b0b..d3bf97d75 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -11,18 +11,11 @@ function web_search() { yahoo "https://search.yahoo.com/search?p=" duckduckgo "https://www.duckduckgo.com/?q=" yandex "https://yandex.ru/yandsearch?text=" + github "https://github.com/search?q=" + baidu "https://www.baidu.com/s?wd=" + ecosia "https://www.ecosia.org/search?q=" ) - # define the open command - case "$OSTYPE" in - darwin*) open_cmd="open" ;; - cygwin*) open_cmd="cygstart" ;; - linux*) open_cmd="xdg-open" ;; - *) echo "Platform $OSTYPE not supported" - return 1 - ;; - esac - # check whether the search engine is supported if [[ -z "$urls[$1]" ]]; then echo "Search engine $1 not supported." @@ -40,7 +33,7 @@ function web_search() { url="${(j://:)${(s:/:)urls[$1]}[1,2]}" fi - nohup $open_cmd "$url" &>/dev/null + open_command "$url" } @@ -49,6 +42,9 @@ alias google='web_search google' alias yahoo='web_search yahoo' alias ddg='web_search duckduckgo' alias yandex='web_search yandex' +alias github='web_search github' +alias baidu='web_search baidu' +alias ecosia='web_search ecosia' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' |