mirror of https://github.com/ohmyzsh/ohmyzsh.git
Compare commits
3 Commits
0d68982aba
...
63523223b4
Author | SHA1 | Date |
---|---|---|
|
63523223b4 | |
|
5c17bcd21f | |
|
66ac7ff0c2 |
|
@ -1,15 +1,25 @@
|
||||||
# node plugin
|
# node plugin
|
||||||
|
|
||||||
This plugin adds `node-docs` function that opens specific section in [Node.js](https://nodejs.org)
|
This plugin provides many a aliases and a few `node-docs` functions.
|
||||||
documentation (depending on the installed version).
|
|
||||||
|
|
||||||
To use it, add `node` to the plugins array of your zshrc file:
|
## Aliases
|
||||||
|
|
||||||
```zsh
|
| Alias | Command |
|
||||||
plugins=(... node)
|
|:---------------------|:-------------------------------------------------------------------------------|
|
||||||
```
|
| nd | node |
|
||||||
|
| ndc | node --check |
|
||||||
|
| nde | node --eval "script" |
|
||||||
|
| ndh | node --help |
|
||||||
|
| ndi | git --interactive |
|
||||||
|
| ndr | git --require module |
|
||||||
|
|----------------------|--------------------------------------------------------------------------------|
|
||||||
|
| ndnd | node --no-depreciation |
|
||||||
|
| ndnw | node --no-warnings |
|
||||||
|
| ndtw | node --trace-warnings |
|
||||||
|
| ndv8 | node --V8-options |
|
||||||
|
|----------------------|--------------------------------------------------------------------------------|
|
||||||
|
|
||||||
## Usage
|
## Functions
|
||||||
|
|
||||||
```zsh
|
```zsh
|
||||||
# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html
|
# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html
|
||||||
|
@ -17,3 +27,13 @@ $ node-docs fs
|
||||||
# Opens https://nodejs.org/docs/latest-v10.x/api/path.html
|
# Opens https://nodejs.org/docs/latest-v10.x/api/path.html
|
||||||
$ node-docs path
|
$ node-docs path
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This plugin adds `node-docs` function that opens specific section in [Node.js](https://nodejs.org)
|
||||||
|
documentation (depending on the installed version).
|
||||||
|
|
||||||
|
## Add plugin
|
||||||
|
To use it, add `node` to the plugins array of your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... node)
|
||||||
|
```
|
|
@ -4,3 +4,20 @@ function node-docs {
|
||||||
local section=${1:-all}
|
local section=${1:-all}
|
||||||
open_command "https://nodejs.org/docs/$(node --version)/api/$section.html"
|
open_command "https://nodejs.org/docs/$(node --version)/api/$section.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# initialise node
|
||||||
|
alias nd='node'
|
||||||
|
|
||||||
|
# Checkout the README.md for
|
||||||
|
# detailed explanation
|
||||||
|
alias ndv='node --version'
|
||||||
|
alias ndc='node -c'
|
||||||
|
alias nde='node -e'
|
||||||
|
alias ndh='node -h'
|
||||||
|
alias ndi='node -i'
|
||||||
|
alias ndr='node -r'
|
||||||
|
|
||||||
|
alias ndnd='node --no-depreciation'
|
||||||
|
alias ndnw='node --no-warnings'
|
||||||
|
alias ndtw='node --trace-warnings'
|
||||||
|
alias ndv8='node --V8-options'
|
|
@ -52,6 +52,7 @@ Available search contexts are:
|
||||||
| `gopkg` | `https://pkg.go.dev/search?m=package&q=` |
|
| `gopkg` | `https://pkg.go.dev/search?m=package&q=` |
|
||||||
| `chatgpt` | `https://chatgpt.com/?q=` |
|
| `chatgpt` | `https://chatgpt.com/?q=` |
|
||||||
| `reddit` | `https://www.reddit.com/search/?q=` |
|
| `reddit` | `https://www.reddit.com/search/?q=` |
|
||||||
|
| `ppai` | `https://www.perplexity.ai/search/new?q=` |
|
||||||
|
|
||||||
Also there are aliases for bang-searching DuckDuckGo:
|
Also there are aliases for bang-searching DuckDuckGo:
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ function web_search() {
|
||||||
gopkg "https://pkg.go.dev/search?m=package&q="
|
gopkg "https://pkg.go.dev/search?m=package&q="
|
||||||
chatgpt "https://chatgpt.com/?q="
|
chatgpt "https://chatgpt.com/?q="
|
||||||
reddit "https://www.reddit.com/search/?q="
|
reddit "https://www.reddit.com/search/?q="
|
||||||
|
ppai "https://www.perplexity.ai/search/new?q="
|
||||||
)
|
)
|
||||||
|
|
||||||
# check whether the search engine is supported
|
# check whether the search engine is supported
|
||||||
|
@ -87,6 +88,7 @@ alias packagist='web_search packagist'
|
||||||
alias gopkg='web_search gopkg'
|
alias gopkg='web_search gopkg'
|
||||||
alias chatgpt='web_search chatgpt'
|
alias chatgpt='web_search chatgpt'
|
||||||
alias reddit='web_search reddit'
|
alias reddit='web_search reddit'
|
||||||
|
alias ppai='web_search ppai'
|
||||||
|
|
||||||
#add your own !bang searches here
|
#add your own !bang searches here
|
||||||
alias wiki='web_search duckduckgo \!w'
|
alias wiki='web_search duckduckgo \!w'
|
||||||
|
|
Loading…
Reference in New Issue