Skip to content

Instantly share code, notes, and snippets.

@roeniss
Created February 10, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roeniss/38ec1d9645783fc3149f1ba10baa834f to your computer and use it in GitHub Desktop.
Save roeniss/38ec1d9645783fc3149f1ba10baa834f to your computer and use it in GitHub Desktop.
script for adding new plugin to zsh
# for example,
# plugins=(git)
# will become :
# plugins=(git zsh-autosuggestions)
# with "addPlugin zsh-autosuggestions"
# add below function to ~/.zsrc, then reload with 'source ~/.zshrc'
addPlugin() { l=`cat ~/.zshrc
| grep -n '^plugins=.*$'
| cut -f1 -d:`;
gsed -r -i ''"$l"'s/\)/ '"$1"'\)/g' ~/.zshrc;
echo "zsh plugins updated."; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment