Created
November 14, 2020 22:58
-
-
Save letelete/36d0d73055dd7a16d6b2c55f3e3d94f5 to your computer and use it in GitHub Desktop.
Adds a vim plugin inside of the .vim/pack/plugins/start/<plugin-name> path and makes it a submodule to easily keep your plugins synced with the github repo initialized inside of the .vim/pack folder.
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
# $1 - A GitHub plugin's repository URL with a '.git' suffix. | |
vimadd () { | |
BUNDLE="" && [[ $1 =~ '\/(.+)\.git' ]] && BUNDLE=$match[1] || echo "Cannot match a repo name" | |
[[ -z "$BUNDLE" ]] && return 0 | |
cd ~/.vim/pack | |
git submodule add $1 plugins/start/$BUNDLE | |
git submodule update --remote --merge | |
git commit -m "Add $BUNDLE plugin" | |
git push origin main | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment