mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-14 22:47:45 +08:00
Compare commits
4 Commits
30f2124b42
...
d5af199039
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5af199039 | ||
|
|
f84341c574 | ||
|
|
92aed2e936 | ||
|
|
66ac7ff0c2 |
@ -117,7 +117,7 @@ function _omz_git_prompt_status() {
|
||||
fi
|
||||
|
||||
# For each status prefix, do a regex comparison
|
||||
for status_prefix in ${(k)prefix_constant_map}; do
|
||||
for status_prefix in "${(@k)prefix_constant_map}"; do
|
||||
local status_constant="${prefix_constant_map[$status_prefix]}"
|
||||
local status_regex=$'(^|\n)'"$status_prefix"
|
||||
|
||||
|
||||
@ -77,7 +77,15 @@ EOF
|
||||
(*.lzma) unlzma "$full_path" ;;
|
||||
(*.z) uncompress "$full_path" ;;
|
||||
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx|*.pk3|*.pk4) unzip "$full_path" ;;
|
||||
(*.rar) unrar x -ad "$full_path" ;;
|
||||
(*.rar)
|
||||
if (( $+commands[unrar] )); then
|
||||
unrar x -ad "$full_path"
|
||||
elif (( $+commands[unar] )); then
|
||||
unar -o . "$full_path"
|
||||
else
|
||||
echo "extract: cannot extract RAR files: install unrar or unar" >&2
|
||||
success=1
|
||||
fi ;;
|
||||
(*.rpm)
|
||||
rpm2cpio "$full_path" | cpio --quiet -id ;;
|
||||
(*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;;
|
||||
|
||||
@ -1,15 +1,25 @@
|
||||
# node plugin
|
||||
|
||||
This plugin adds `node-docs` function that opens specific section in [Node.js](https://nodejs.org)
|
||||
documentation (depending on the installed version).
|
||||
This plugin provides many a aliases and a few `node-docs` functions.
|
||||
|
||||
To use it, add `node` to the plugins array of your zshrc file:
|
||||
## Aliases
|
||||
|
||||
```zsh
|
||||
plugins=(... node)
|
||||
```
|
||||
| Alias | Command |
|
||||
|:---------------------|:-------------------------------------------------------------------------------|
|
||||
| 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
|
||||
# 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
|
||||
$ 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}
|
||||
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'
|
||||
Loading…
Reference in New Issue
Block a user