Vim

From assela Pathirana
Jump to navigationJump to search

A simple .vimrc file

Usually the following content in ~/.vimrc file is enough to tame vim to match my editing requirements.

set nocompatible "We are running vim not old we no need to be constrained!
set bs=2 "backspace works. 
set smartindent "indents programs
set tabstop=4   "tab stops 4 chars
set shiftwidth=4 "autoindent width
"Shortcut to auto indent entire file
nmap <F11> 1G=G
imap <F11> <ESC>1G=Ga
set incsearch
set ignorecase
set smartcase 
"Informative status line
set statusline=%F%m%r%h%w\ [TYPE=%Y\ %{&ff}]\ [%l/%L\ (%p%%)]
"Have 3 lines of offset (or buffer) when scrolling
set scrolloff=3