Vim Basic Configuration - Chirag Patel Dec 14, 2008
— Edit “~/.vimrc” file and add following tags per need
set autoindent ==> auto-indent code
set incsearch ==> start searching as we type word for search
set hlsearch ==> highlight all occurrences for search
set nowrap ==> disable line wrapping
set ts=4 ==> set tabsize to 4 space size
set softtabstop=4 ==> tabbing match my tabsize of 4
set shiftwidth=4 ==> shifting match my tabsize of 4
set noexpandtab ==> do not replace tab with spaces
set showmatch ==> highlight matching bracket/braces as we move cursor
set mat=5 ==> matching for search
set nocompatible ==> no vi compatibility
filetype on ==> vim detects file type
syntax on ==> highlight syntax words for file type
set ruler
set cindent ==> “C” indent rules for auto-indent
==> following command restores file position while re-opening
autocmd BufReadPost *
\ if expand(”:p:h”) !=? $TEMP |
\ if line(”‘\”") > 0 && line(”‘\”") following command postpones using “zv” until after reading the modelines
autocmd BufWinEnter *
\ if exists(”b:doopenfold”) |
\ unlet b:doopenfold |
\ exe “normal zv” |
\ endif
Posted under Infrastructure, Linux
This post was written by Chirag on December 15, 2008
