Home

Awesome

web-search plugin

This is a standalone plugin for zsh with no need of installing Oh-my-zsh

Open your ~/.zshrc file and add this line source < Path where web-search.plugin.zsh file is located >

For example

source ~/.config/zsh/web-search/web-search.plugin.zsh

Usage

This plugin adds aliases for searching with Google, Wiki, Bing, YouTube and other popular services.

You can use the web-search plugin in these two forms:

For example, these two are equivalent:

$ web_search google oh-my-zsh
$ google oh-my-zsh

Available search contexts are:

ContextURL
binghttps://www.bing.com/search?q=
googlehttps://www.google.com/search?q=
brs or bravehttps://search.brave.com/search?q=
yahoohttps://search.yahoo.com/search?p=
ddg or duckduckgohttps://www.duckduckgo.com/?q=
sp or startpagehttps://www.startpage.com/do/search?q=
yandexhttps://yandex.ru/yandsearch?text=
githubhttps://github.com/search?q=
baiduhttps://www.baidu.com/s?wd=
ecosiahttps://www.ecosia.org/search?q=
goodreadshttps://www.goodreads.com/search?q=
qwanthttps://www.qwant.com/?q=
giverohttps://www.givero.com/search?q=
stackoverflowhttps://stackoverflow.com/search?q=
wolframalpha or wahttps://wolframalpha.com/input?i=
archivehttps://web.archive.org/web/*/
scholarhttps://scholar.google.com/scholar?q=
askhttps://www.ask.com/web?q=

Also there are aliases for bang-searching DuckDuckGo:

ContextBang
wiki!w
news!n
youtube!yt
map!m
image!i
ducky!

Custom search engines

If you want to add other search engines add this to your .zshrc:

export 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:

export 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>.