Table of Contents

Vim

Syntax Highlighting

To enable syntax highlighting for unique file names edit:
/home/USERNAME/.vimrc

au BufNewFile,BufRead FILE.NAME      setf SYNTAX

Syntax files are in:
/usr/share/vim/vim74/syntax/


Search and Replace

Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.

:%s/foo/bar/gc

Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation.

:%s/\<foo\>/bar/gc

http://vim.wikia.com/wiki/Search_and_replace