From 52e848ce8f8d7370a202e0bee07ce2c32858932e Mon Sep 17 00:00:00 2001 From: Sibs <68712272+Bryan-netizen@users.noreply.github.com> Date: Fri, 14 Oct 2022 20:07:26 +0300 Subject: [PATCH] feat(web-search): add support for Brave search engine (#11106) --- plugins/web-search/README.md | 3 ++- plugins/web-search/web-search.plugin.zsh | 34 +++++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index da90f90a0..54232a910 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -25,9 +25,10 @@ $ google oh-my-zsh Available search contexts are: | Context | URL | -|-----------------------|------------------------------------------| +| --------------------- | ---------------------------------------- | | `bing` | `https://www.bing.com/search?q=` | | `google` | `https://www.google.com/search?q=` | +| `brs` or `brave` | `https://search.brave.com/search?q=` | | `yahoo` | `https://search.yahoo.com/search?p=` | | `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=` | | `sp` or `startpage` | `https://www.startpage.com/do/search?q=` | diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 229948894..d8b4a7f8b 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -7,22 +7,23 @@ function web_search() { typeset -A urls urls=( $ZSH_WEB_SEARCH_ENGINES - google "https://www.google.com/search?q=" - bing "https://www.bing.com/search?q=" - yahoo "https://search.yahoo.com/search?p=" - duckduckgo "https://www.duckduckgo.com/?q=" - startpage "https://www.startpage.com/do/search?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=" - goodreads "https://www.goodreads.com/search?q=" - qwant "https://www.qwant.com/?q=" - givero "https://www.givero.com/search?q=" - stackoverflow "https://stackoverflow.com/search?q=" - wolframalpha "https://www.wolframalpha.com/input/?i=" - archive "https://web.archive.org/web/*/" - scholar "https://scholar.google.com/scholar?q=" + google "https://www.google.com/search?q=" + bing "https://www.bing.com/search?q=" + brave "https://search.brave.com/search?q=" + yahoo "https://search.yahoo.com/search?p=" + duckduckgo "https://www.duckduckgo.com/?q=" + startpage "https://www.startpage.com/do/search?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=" + goodreads "https://www.goodreads.com/search?q=" + qwant "https://www.qwant.com/?q=" + givero "https://www.givero.com/search?q=" + stackoverflow "https://stackoverflow.com/search?q=" + wolframalpha "https://www.wolframalpha.com/input/?i=" + archive "https://web.archive.org/web/*/" + scholar "https://scholar.google.com/scholar?q=" ) # check whether the search engine is supported @@ -47,6 +48,7 @@ function web_search() { alias bing='web_search bing' +alias brs='web_search brave' alias google='web_search google' alias yahoo='web_search yahoo' alias ddg='web_search duckduckgo'