my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.6 KiB

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