summaryrefslogtreecommitdiff
path: root/plugins/web-search
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/web-search')
-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'