mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 01:52:31 +01:00
web-search: allow custom search engines
This commit is contained in:
parent
3c777ebf1b
commit
60442dc47b
2 changed files with 36 additions and 1 deletions
|
|
@ -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>`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue