Giter VIP home page Giter VIP logo

web-search.fish's Introduction

web-search.fish

Demo

A plugin to do a web search via fish. Inspired by oh-my-zsh/web-search

Requirement

Installation

Install with Fisher:

fisher install veirt/web-search.fish

Usage

web-search google nyahello, world

You can also define aliases in your fish config:

alias google="web-search google"
alias stackoverflow="web-search stackoverflow"
alias github="web-search github"

And now, you can also do it like this:

google nyahello, world

Available search contexts:

Context URL
google https://www.google.com/search?q=
youtube https://www.youtube.com/results?search_query=
bing https://www.bing.com/search?q=
yahoo https://search.yahoo.com/search?p=
duckduckgo https://www.duckduckgo.com/?q=
startpage https://www.startpage.com/do/search?q=
yandex https://yandex.ru/yandsearch?text=
github https://github.com/search?q=
baidu https://www.baidu.com/s?wd=
ecosia https://www.ecosia.org/search?q=
goodreads https://www.goodreads.com/search?q=
qwant https://www.qwant.com/?q=
givero https://www.givero.com/search?q=
stackoverflow https://stackoverflow.com/search?q=
wolframalpha https://wolframalpha.com/input?i=
archive https://web.archive.org/web/*/
scholar https://scholar.google.com/scholar?q=
nixpkgs https://search.nixos.org/packages?query=
nixoptions https://search.nixos.org/options?query=
aur https://aur.archlinux.org/packages?K=
gpo https://gpo.zugaina.org/Search?search=
searx https://searx.org/search?q=
brave https://search.brave.com/search?q=
urbandict https://www.urbandictionary.com/define.php?term=
deepl https://www.deepl.com/translator#auto/auto/
dockerhub https://hub.docker.com/search?q=
npmpkg https://www.npmjs.com/search?q=
packagist https://packagist.org/?query=
gopkg https://pkg.go.dev/search?m=package&q=

Custom Search

Additionally, you can set up a custom search with a different URL by defining a new environment variable with a WEB_SEARCH_ prefix and a unique context name. Simply set the URL you desire as the value for this new environment variable.

For example, if you want to make a search to the URL https://dictionary.cambridge.org/dictionary/english/ with the context dict, you can use the following command or put it directly in your config.fish:

set -gx WEB_SEARCH_dict 'https://dictionary.cambridge.org/dictionary/english/'

You can now search with:

web-search dict word

Or, with an alias:

alias dict='web-search dict'
dict word

Credits

FAQ

Why is it not opening my browser of choice?

Run this command in your shell. For example, if you want to change it to Firefox:

xdg-settings set default-web-browser firefox.desktop

You can replace firefox.desktop with whatever the name of your browser desktop entry:

  • Google Chrome: google-chrome.desktop
  • Chromium: chromium.desktop

You can find your browser's desktop entry in /usr/share/applications/ or in ~/.local/share/applications/

License

GNU GPLv3

web-search.fish's People

Contributors

bbenno avatar cgyinthehouse avatar veirt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cgyinthehouse

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.