30 May 2011

VI customizations for syntax coloring, auto-indenting and more

A colleague recently sent me a VIM resource file to configure how VIM displays code.

A small set of simple changes, but the effect is very nice and makes the casual viewing of code, scripts, etc. much nicer with line numbering, auto-indenting,  syntax color coding, etc.
$ cat ~/.vimrc

set shiftwidth=2 
set tabstop=2 
set number 
set ruler 
set expandtab 
set smartindent 
set autoindent 
set showmatch 
:syntax enable 
highlight Statement ctermfg=white
highlight PreProc ctermfg=3
set pastetoggle=<F10>

This is what it looks with a Java file:

Thanks Mark.

No comments: