mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
add yandex support to web-search plugin
This commit is contained in:
parent
96e4e5dd03
commit
9b6a6af130
1 changed files with 5 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ function web_search() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check whether the search engine is supported
|
# check whether the search engine is supported
|
||||||
if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]];
|
if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo|yandex)' ]];
|
||||||
then
|
then
|
||||||
echo "Search engine $1 not supported."
|
echo "Search engine $1 not supported."
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -26,6 +26,8 @@ function web_search() {
|
||||||
if [[ $1 == 'duckduckgo' ]]; then
|
if [[ $1 == 'duckduckgo' ]]; then
|
||||||
#slightly different search syntax for DDG
|
#slightly different search syntax for DDG
|
||||||
url="${url}/?q="
|
url="${url}/?q="
|
||||||
|
elif [[ $1 == 'yandex' ]]; then
|
||||||
|
url="http://yandex.ru/yandsearch?text="
|
||||||
else
|
else
|
||||||
url="${url}/search?q="
|
url="${url}/search?q="
|
||||||
fi
|
fi
|
||||||
|
|
@ -44,6 +46,8 @@ function web_search() {
|
||||||
|
|
||||||
alias bing='web_search bing'
|
alias bing='web_search bing'
|
||||||
alias google='web_search google'
|
alias google='web_search google'
|
||||||
|
alias yandex='web_search yandex'
|
||||||
|
alias ya='web_search yandex'
|
||||||
alias yahoo='web_search yahoo'
|
alias yahoo='web_search yahoo'
|
||||||
alias ddg='web_search duckduckgo'
|
alias ddg='web_search duckduckgo'
|
||||||
#add your own !bang searches here
|
#add your own !bang searches here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue