mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
feat(npm): toggle npm install / npm uninstall by pressing F2 twice (#9717)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
parent
2acb3071ca
commit
ce9104c4f3
2 changed files with 57 additions and 0 deletions
|
|
@ -29,3 +29,20 @@ plugins=(... npm)
|
|||
| `npmI` | `npm init` | Run npm init |
|
||||
| `npmi` | `npm info` | Run npm info |
|
||||
| `npmSe` | `npm search` | Run npm search |
|
||||
|
||||
## `npm install` / `npm uninstall` toggle
|
||||
|
||||
The plugin adds a function that toggles between `npm install` and `npm uninstall` in
|
||||
the current command or the last command, for up to 2 previous commands. **The default
|
||||
key binding is pressing <kbd>F2</kbd> twice**.
|
||||
|
||||
You can change this key binding by adding the following line to your zshrc file:
|
||||
|
||||
```zsh
|
||||
bindkey -M emacs '<seq>' npm_toggle_install_uninstall
|
||||
bindkey -M vicmd '<seq>' npm_toggle_install_uninstall
|
||||
bindkey -M viins '<seq>' npm_toggle_install_uninstall
|
||||
```
|
||||
|
||||
where `<seq>` is a key sequence obtained by running `cat` and pressing the keyboard
|
||||
sequence you want.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue