Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.92 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.92 KB

Installation:

git clone https://github.com/nandub/dotvim.git ~/.vim

Create symlinks:

ln -s ~/.vim/vimrc ~/.vimrc

Switch to the ~/.vim directory, and fetch submodules:

cd ~/.vim
git submodule init
git submodule update

Install plugins as submodules

With pathogen installed, it’s now possible to keep the files for each plugin together, which means that every plugin can be kept in its own git repository. The best way to do this is to use git submodules, which are designed especially for the purpose of keeping git repositories within a git repository.

To install the fugitive plugin as a git submodule, take the following steps:

cd ~/.vim
mkdir ~/.vim/bundle
git submodule add https://github.com/tpope/vim-fugitive.git bundle/fugitive
git add .
git commit -m "Install Fugitive.vim bundle as a submodule."

Installing your Vim environment on another machine

Once your vim configuration is under version control, it’s quite straightforward to import your settings to any machine that has git installed. If you followed the instructions above to put your vimrc and plugins in a dotvim directory, then you can follow these steps to synchronise them to another machine:

cd ~
git clone https://github.com/username/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
cd ~/.vim
git submodule init
git submodule update

...the last two git commands can be rolled in to one: git submodule update --init

Upgrading a plugin bundle

At some point in the future, the fugitive plugin might be updated. To fetch the latest changes, go into the fugitive repository, and pull the latest version:

cd ~/.vim/bundle/fugitive
git pull origin master

Upgrading all bundled plugins

You can use the foreach command to execute any shell script in from the root of all submodule directories. To update to the latest version of each plugin bundle, run the following:

git submodule foreach git pull origin master