I have been fiddling with Vim lately while I was learning Ruby on Rails. The only thing I was learning was
movement keys after using mVim for about a few months, on and off.1
hjkl
So I decided to do something fancy, to sync them across my mac. Totally have nothing to do with improving vim foo, but it’s fun. I got started from this blog post from VimCasts using Pathogen.
But being in love with Vundle after using spf13, I insist on using Vundle. Turns out, it’s much easier with Vundle since no need to install git submodule or update them. Vundle takes care all of them for you.
Note: if you are farmilar with everything, have your .vim on github and just want to switch to Vundle, there are two steps:
- Install Vundle as usual. Instruction is here
- Put
to your .gitignore.1
~/.vim/bundle
- See my example, sloppy github repo
Here is the long step by step version.
Setting up ~.vim
I’m going to be short and brief here. Read the original post if you are confused on the steps.
If you have your own
directory and 1
~/.vim
file, let’s gather them into 1
.vimrc
directory and then symlink your .vimrc and .gvimrc files:1
~/.vim
Setting Up Git
Turns your .vim directory to a git directory, make an empty README, commit.
Now that you have a local git, makes a repository on github. If you are unsure how to do that, visit this help page
Obtain your git repo link such as
. Add that repo in github.com to your remote. Use the link to your own repository below1
git@github.com:username/repository-name.git
Now you have everything linked up to your github, we are ready to install Vundle.
Setting Up Vundle
First, let’s install Vundle in your machine:
Then make sure these are in your
to use Vundle:1
.vimrc
You of course can read more about Vundle here
Install and Manage Bundles
With Vundles installed, to install any git-managed plugins, find the corresponding git directory and the link to your
file such as:1
.vimrc
So now, open Vim (or mVim) and install the bundles with:
1
:BundleInstall
All your bundles that you put in
should install now.1
.vimrc
Let Vundle Manage Bundles
The only thing we are going to sync is your .vimrc. We will not sync Vundle bundles or even Vundles itself. We’ll let Vundles manage all of that. So, don’t let git manage your
folder, exclude it with .gitignore1
~/.vim/bundle