diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-06-10 12:04:14 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2020-06-10 12:04:14 +0200 |
commit | 60442dc47b9092375bb41a1f803b25389c834427 (patch) | |
tree | 0381520dc8e5cb0e0d75c462126817005d3c9ffc /plugins/web-search/README.md | |
parent | 3c777ebf1b24826363bea6bc29afa9ba038b10e8 (diff) | |
download | zsh-60442dc47b9092375bb41a1f803b25389c834427.tar.gz zsh-60442dc47b9092375bb41a1f803b25389c834427.tar.bz2 zsh-60442dc47b9092375bb41a1f803b25389c834427.zip |
web-search: allow custom search engines
Diffstat (limited to 'plugins/web-search/README.md')
-rw-r--r-- | plugins/web-search/README.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index 81908fb94..ad5080a44 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -52,3 +52,27 @@ Also there are aliases for bang-searching DuckDuckGo: | `map` | `!m` | | `image` | `!i` | | `ducky` | `!` | + +### Custom search engines + +If you want to add other search contexts to the plugin, you can use the +`$ZSH_WEB_SEARCH_ENGINES` variable. Set it before Oh My Zsh is sourced, +with the following format: + +```zsh +ZSH_WEB_SEARCH_ENGINES=( + <context> <URL> + <context> <URL> +) +``` + +where `<context>` is the name of the search context, and `<URL>` a URL of +the same type as the search contexts above. For example, to add `reddit`, +you'd do: + +```zsh +ZSH_WEB_SEARCH_ENGINES=(reddit "https://www.reddit.com/search/?q=") +``` + +These custom search engines will also be turned to aliases, so you can +both do `web_search reddit <query>` or `reddit <query>`. |