Skip to content

GowayLee/zsh_web_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ZSH Web Search

A web search plugin for ZSH.

Installation

  1. Clone this repository to your local machine.
  2. Add the following line to your .zshrc file:
source /path/to/zsh-web-search/zsh-web-search.zsh
  1. Restart your terminal or source your .zshrc file.

Usage

  • To perform a web search, simply type web_search followed by your search query and press Enter. The plugin will open your default web browser and perform the search using the specified search engine.

        web_search google zsh

    If there is no parameter of searching keywords, it will open the homepage of the search engine.

        web_search google
  • To make it more efficient, you can set aliases for the search engines you use most frequently. For example, you can add the following lines to your .zshrc or zsh-web-search.zsh file:

        alias google='web_search google'
        alias bing='web_search bing'

    Now, you can use google and bingas aliases for the corresponding search engines.

        google zsh
        bing zsh

Customization

To add more search engines, you can add them to the zsh-web-search.zsh file. For example, to add the parameter for GitHub, add the entry to this Associative Array:

    declare -A search_url_arr=(
        ...
        ["github"]="https://github.com/search?q="
        ...
    )

TODO

  • Change alias and variables. Prevent from confusing with other shell variables.
  • Feature to display all the support search engines.

About

A web-searching plugin for zsh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages