This plugin shows autocomplete suggestions for npm
scripts from package.json
at current working directory.
Works with npm
, yarn
, bun
and pnpm
.
Clone this repository to your oh-my-zsh plugins folder
(by default ~/.oh-my-zsh/custom/plugins
):
git clone \
git@github.com:grigorii-zander/zsh-npm-scripts-autocomplete.git \
~/.oh-my-zsh/custom/plugins/zsh-npm-scripts-autocomplete
Add plugin to your .zshrc
config:
plugins=(
zsh-npm-scripts-autocomplete
)
Restart your terminal or reload .zshrc
config with the following command:
source ~/.zshrc
Invoke selected script with a single hit of Enter/Return
.
zmodload -i zsh/complist
bindkey -M menuselect '^M' .accept-line