summaryrefslogtreecommitdiff
path: root/plugins/web-search/web-search.plugin.zsh
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-09-03 13:05:24 -0400
committerAndrew Janke <andrew@apjanke.net>2015-09-03 13:05:24 -0400
commit93b4a6c02eeafb875de5d9bcccd73bdcd8265f40 (patch)
tree7cc87fcd416bf71cee77f30bf2e60cf607671f43 /plugins/web-search/web-search.plugin.zsh
parent689b5ab3c8c8bf30ee63cafb8401d7d95e41f359 (diff)
parent0532860c618aabc02d5dab34391b967e8e4c6272 (diff)
downloadzsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.tar.gz
zsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.tar.bz2
zsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.zip
Merge branch 'master' into osx-fix-tab-for-iterm
Conflicts: plugins/osx/osx.plugin.zsh
Diffstat (limited to 'plugins/web-search/web-search.plugin.zsh')
-rw-r--r--plugins/web-search/web-search.plugin.zsh14
1 files changed, 3 insertions, 11 deletions
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index d407edb96..369a0e680 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -12,18 +12,9 @@ function web_search() {
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="
)
- # 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."
@@ -41,7 +32,7 @@ function web_search() {
url="${(j://:)${(s:/:)urls[$1]}[1,2]}"
fi
- nohup $open_cmd "$url" &>/dev/null
+ open_command "$url"
}
@@ -51,6 +42,7 @@ 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'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'