Created
February 10, 2020 13:04
-
-
Save roeniss/38ec1d9645783fc3149f1ba10baa834f to your computer and use it in GitHub Desktop.
script for adding new plugin to zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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