Difference between revisions of "Vim"

From assela Pathirana
Jump to navigationJump to search
(Created page with '==A simple <tt>.vimrc</tt> file== Usually the following content in <tt>~/.vimrc</tt> file is enough to tame vim to match my editing requirements. <pre> set nocompatible " I use…')
 
 
Line 3: Line 3:


<pre>
<pre>
set nocompatible " I use vim, not old vi
set nocompatible "We are running vim not old we no need to be constrained!
set autoindent "with the
set bs=2 "backspace works.
set smartindent
set smartindent "indents programs
set tabstop=4
set tabstop=4   "tab stops 4 chars
set shiftwidth=4
set shiftwidth=4 "autoindent width
set showmatch
"Shortcut to auto indent entire file
set guioptions-=T " no toolbar when using gui version
nmap <F11> 1G=G
set vb t_vb= " no sounds please!
imap <F11> <ESC>1G=Ga
set ruler " show status
set incsearch
set incsearch "I'm impatient show partial matches when searching
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
</pre>
</pre>


[[Category:Computing]][[Category:Unix]]
[[Category:Computing]][[Category:Unix]]

Latest revision as of 13:00, 7 March 2011

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