Time and again I have to create a
.vimrc file, and each time I have to lookup the internet to find out commands for VI. The problem is that to find out the commands that suit my preferences, I have to traverse a lot of links and sample
.vimrc files. So I decided to consolidate my preferences at a single location. This sample
.vimrc file has to be kept in your home directory (/home/user), and I use it for C/C++ development. You can use this sample
.vimrc file as well, but I'll also assume you use the '
NERDTree' plugin and use a machine with mouse support :P. (NERDTree is one of the best VI plugins.)
First of all, VIM is not installed on Ubuntu by default. (VI does not have mouse support). Installing vim is easy.
sudo apt-get install vim
This is my
.vimrc file. Place it in the home directory.
set nocompatible
set shiftwidth=4
set tabstop=4
set expandtab
set mouse=a
map <F2> :NERDTreeToggle <cr>
set smartindent
set smartcase