1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-05 09:43:38 +08:00
ohmyzsh/plugins/frontend-search/README.md

86 lines
4.4 KiB
Markdown
Raw Normal View History

## Introduction
2014-06-20 10:27:40 +08:00
2015-09-01 01:17:16 +08:00
> Searches for your frontend web development made easier
2015-04-26 22:43:45 +08:00
## Installation
2014-06-20 10:27:40 +08:00
2015-09-01 01:17:16 +08:00
Open your `~/.zshrc` file and enable the `frontend-search` plugin:
2014-06-20 10:27:40 +08:00
2015-09-01 01:17:16 +08:00
```zsh
plugins=( ... frontend-search)
2014-06-20 10:27:40 +08:00
```
## Usage
2015-09-01 01:17:16 +08:00
You can use the frontend-search plugin in these two forms:
- `frontend <context> <term> [more terms if you want]`
- `<context> <term> [more terms if you want]`
2015-09-01 01:17:16 +08:00
For example, these two are equivalent:
```zsh
$ angular dependency injection
# Will turn into ...
$ frontend angular dependency injection
2015-09-01 01:17:16 +08:00
```
Available search contexts are:
| context | URL |
| ------------- | --------------------------------------------------------------------------- |
| angular | `https://angular.io/?search=` |
| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` |
| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` |
| bootsnipp | `https://bootsnipp.com/search?q=` |
| bundlephobia | `https://bundlephobia.com/result?p=` |
| caniuse | `https://caniuse.com/#search=` |
| codepen | `https://codepen.io/search?q=` |
| compassdoc | `http://compass-style.org/search?q=` |
| cssflow | `http://www.cssflow.com/search?q=` |
| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` |
| emberjs | `https://www.google.com/search?as_sitesearch=emberjs.com/&as_q=` |
| flowtype | `https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=` |
| fontello | `http://fontello.com/#search=` |
| github | `https://github.com/search?q=` |
| html5please | `https://html5please.com/#` |
| jestjs | `https://www.google.com/search?as_sitesearch=jestjs.io&as_q=` |
| jquery | `https://api.jquery.com/?s=` |
| lodash | `https://devdocs.io/lodash/index#` |
| mdn | `https://developer.mozilla.org/search?q=` |
| nodejs | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=` |
| npmjs | `https://www.npmjs.com/search?q=` |
| packagephobia | `https://packagephobia.now.sh/result?p=` |
| qunit | `https://api.qunitjs.com/?s=` |
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` |
| stackoverflow | `https://stackoverflow.com/search?q=` |
| typescript | `https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=` |
| unheap | `http://www.unheap.com/?s=` |
| vuejs | `https://www.google.com/search?as_sitesearch=vuejs.org&as_q=` |
2023-12-06 16:13:19 +08:00
| nextjs | `https://www.google.com/search?as_sitesearch=nextjs.org&as_q=` |
2015-09-01 01:17:16 +08:00
If you want to have another context, open an Issue and tell us!
2014-06-20 10:27:40 +08:00
## Fallback search behaviour
The plugin will use Google as a fallback if the docs site for a search context does not have a search
function. You can set the fallback search engine to DuckDuckGo by setting
`FRONTEND_SEARCH_FALLBACK='duckduckgo'` in your `~/.zshrc` file before Oh My Zsh is sourced.
## DuckDuckGo Lucky Search
Enable DuckDuckGo's "ducky" (lucky) search feature to automatically access the top search result. This feature
is optimized for DuckDuckGo, as Google redirects to an intermediate page. The FRONTEND_SEARCH_FALLBACK_LUCKY
environment variable triggers the use of DuckDuckGo's lucky search, rendering the FRONTEND_SEARCH_FALLBACK
setting unnecessary in this context.
2014-06-20 10:27:40 +08:00
## Author
**Wilson Mendes (willmendesneto)**
- <https://twitter.com/willmendesneto>
- <https://github.com/willmendesneto>