snipMate is a useful vim plugin which allows short cuts like for’tab’ to be set up which will insert the snippet:

for (i = 0; i < count; i++) {  


To install you just have to download the the zip file from snipMate and copy the files into your vim folder (~/.vim).

Make sure you have this in your .vimrc file

filetype plugin on

I still could not get tab completion to work. running :scriptnames inside vim will list the files it has loaded and should include:


On my first install the plugin/snipMate.vim was not executable and therefore the after/plugin/snipMate.vim did not get loaded.

The Fix

cd ~/.vim 
chmod ugo+x plugin/snipMate.vim