Sunday, August 01, 2010

Vim Niceties

Some features that newbies may not know about:

1. Some default settings that I have found useful

In your .vimrc file:
set tabstop=4
set number
set nocompatible
set smartindent
set shiftwidth=4
set mouse=a

Basically sets line numbers, smart indentation, width of tabstop to be 4, and allow the use of the mouse for inserting text.

2. Omnicompletion

In your .vimrc file, add:
filetype plugin on
set oft=syntaxcomplete#Complete

Hit Control-P to see the completion menu pop up when editing code.

3. Auto highlight red whenever you exceed 80 chars in one line

highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.\+/

No comments: