]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/web-search/README.md
54232a9102365fd48dc6bf3b3fa327146540b659
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / web-search / README.md
1 # web-search plugin
2
3 This plugin adds aliases for searching with Google, Wiki, Bing, YouTube and other popular services.
4
5 Open your `~/.zshrc` file and enable the `web-search` plugin:
6
7 ```zsh
8 plugins=( ... web-search)
9 ```
10
11 ## Usage
12
13 You can use the `web-search` plugin in these two forms:
14
15 * `web_search <context> <term> [more terms if you want]`
16 * `<context> <term> [more terms if you want]`
17
18 For example, these two are equivalent:
19
20 ```zsh
21 $ web_search google oh-my-zsh
22 $ google oh-my-zsh
23 ```
24
25 Available search contexts are:
26
27 | Context               | URL                                      |
28 | --------------------- | ---------------------------------------- |
29 | `bing`                | `https://www.bing.com/search?q=`         |
30 | `google`              | `https://www.google.com/search?q=`       |
31 | `brs` or `brave`      | `https://search.brave.com/search?q=`     |
32 | `yahoo`               | `https://search.yahoo.com/search?p=`     |
33 | `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=`         |
34 | `sp` or `startpage`   | `https://www.startpage.com/do/search?q=` |
35 | `yandex`              | `https://yandex.ru/yandsearch?text=`     |
36 | `github`              | `https://github.com/search?q=`           |
37 | `baidu`               | `https://www.baidu.com/s?wd=`            |
38 | `ecosia`              | `https://www.ecosia.org/search?q=`       |
39 | `goodreads`           | `https://www.goodreads.com/search?q=`    |
40 | `qwant`               | `https://www.qwant.com/?q=`              |
41 | `givero`              | `https://www.givero.com/search?q=`       |
42 | `stackoverflow`       | `https://stackoverflow.com/search?q=`    |
43 | `wolframalpha`        | `https://wolframalpha.com/input?i=`      |
44 | `archive`             | `https://web.archive.org/web/*/`         |
45 | `scholar`             | `https://scholar.google.com/scholar?q=`  |
46
47 Also there are aliases for bang-searching DuckDuckGo:
48
49 | Context   | Bang  |
50 |-----------|-------|
51 | `wiki`    | `!w`  |
52 | `news`    | `!n`  |
53 | `youtube` | `!yt` |
54 | `map`     | `!m`  |
55 | `image`   | `!i`  |
56 | `ducky`   | `!`   |
57
58 ### Custom search engines
59
60 If you want to add other search contexts to the plugin, you can use the
61 `$ZSH_WEB_SEARCH_ENGINES` variable. Set it before Oh My Zsh is sourced,
62 with the following format:
63
64 ```zsh
65 ZSH_WEB_SEARCH_ENGINES=(
66     <context> <URL>
67     <context> <URL>
68 )
69 ```
70
71 where `<context>` is the name of the search context, and `<URL>` a URL of
72 the same type as the search contexts above. For example, to add `reddit`,
73 you'd do:
74
75 ```zsh
76 ZSH_WEB_SEARCH_ENGINES=(reddit "https://www.reddit.com/search/?q=")
77 ```
78
79 These custom search engines will also be turned to aliases, so you can
80 both do `web_search reddit <query>` or `reddit <query>`.