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
|
||||
|
||||
# check whether the search engine is supported
|
||||
if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]];
|
||||
if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo|yandex)' ]];
|
||||
then
|
||||
echo "Search engine $1 not supported."
|
||||
return 1
|
||||
|
|
@ -26,6 +26,8 @@ function web_search() {
|
|||
if [[ $1 == 'duckduckgo' ]]; then
|
||||
#slightly different search syntax for DDG
|
||||
url="${url}/?q="
|
||||
elif [[ $1 == 'yandex' ]]; then
|
||||
url="http://yandex.ru/yandsearch?text="
|
||||
else
|
||||
url="${url}/search?q="
|
||||
fi
|
||||
|
|
@ -44,6 +46,8 @@ function web_search() {
|
|||
|
||||
alias bing='web_search bing'
|
||||
alias google='web_search google'
|
||||
alias yandex='web_search yandex'
|
||||
alias ya='web_search yandex'
|
||||
alias yahoo='web_search yahoo'
|
||||
alias ddg='web_search duckduckgo'
|
||||
#add your own !bang searches here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue