summaryrefslogtreecommitdiff
path: root/plugins/web-search
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-10-24 17:57:01 +0200
committerGitHub <noreply@github.com>2019-10-24 17:57:01 +0200
commitcad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9 (patch)
tree2b07ec259bbd2b1a4919245669900a87fa87a03b /plugins/web-search
parent225425fe091ca052997833279ccc08643818c24a (diff)
parent40df67bc3b9b51caa24df5d220487043040d1f9a (diff)
downloadzsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.tar.gz
zsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.tar.bz2
zsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.zip
Merge branch 'master' into fabric_task_description
Diffstat (limited to 'plugins/web-search')
-rw-r--r--plugins/web-search/README.md52
-rw-r--r--plugins/web-search/web-search.plugin.zsh8
2 files changed, 60 insertions, 0 deletions
diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md
new file mode 100644
index 000000000..d04042506
--- /dev/null
+++ b/plugins/web-search/README.md
@@ -0,0 +1,52 @@
+# web-search plugin
+
+This plugin adds aliases for searching with Google, Wiki, Bing, YouTube and other popular services.
+
+Open your `~/.zshrc` file and enable the `web-search` plugin:
+
+```zsh
+plugins=( ... web-search)
+```
+
+## Usage
+
+You can use the `web-search` plugin in these two forms:
+
+* `web_search <context> <term> [more terms if you want]`
+* `<context> <term> [more terms if you want]`
+
+For example, these two are equivalent:
+
+```zsh
+$ web_search google oh-my-zsh
+$ google oh-my-zsh
+```
+
+Available search contexts are:
+
+| Context | URL |
+|-----------------------|------------------------------------------|
+| `bing` | `https://www.bing.com/search?q=` |
+| `google` | `https://www.google.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=` |
+| `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=` |
+
+Also there are aliases for bang-searching DuckDuckGo:
+
+| Context | Bang |
+|-----------|-------|
+| `wiki` | `!w` |
+| `news` | `!n` |
+| `youtube` | `!yt` |
+| `map` | `!m` |
+| `image` | `!i` |
+| `ducky` | `!` |
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 3b5478ca2..5b76eeae2 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -15,6 +15,10 @@ function web_search() {
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="
)
# check whether the search engine is supported
@@ -47,6 +51,10 @@ alias yandex='web_search yandex'
alias github='web_search github'
alias baidu='web_search baidu'
alias ecosia='web_search ecosia'
+alias goodreads='web_search goodreads'
+alias qwant='web_search qwant'
+alias givero='web_search givero'
+alias stackoverflow='web_search stackoverflow'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'