using git submodules to track vim/tmux/zsh extensions
11 Jan 2016Use aliases
In the root folder of my dotfiles, my home directory. I have a .gitmodules file that lists each extension along with its name and directory. I have .oh-my-zsh, tmux and vim extensions included. To make it easier I made new aliases to add modules, update and one to quickly edit the modules file if I ever needed to.
# git submodules
alias gitmods="vim .gitmodules "
alias gitnewmod="git submodule add "
alias gitmodupdate="git submodule update "
# vim bundles folder
alias vimbundles='cd ~/.vim/bundle'
add your extension
Grab the link e.g https://github.com/easymotion/vim-easymotion, navigate to your vim extensions folder. I prefer to use pathogen, all I you need to do is place the file in the bundle folder.
vimbundles
and to clone it as a submodule
gitnewmod https://github.com/easymotion/vim-easymotion
profit
You can even checkout the .gitmodule file to see if it has been update.gitmods
If everything went well, the gitmodules file should look like this
[submodule ".vim/bundle/vim-easymotion"]
path = .vim/bundle/vim-easymotion
url = https://github.com/easymotion/vim-easymotion.git
References
my dotfiles You can see what other extensions am using.
gitmodules manual Sometimes you need the manual.