Search and replace over next n lines
If I copy and paste code in a windows/putty environment it often replaces tabs with space characters and I'd prefer to change these back. For example, to replace spaces with a tab in the next 20 lines:
:.,+20s/\s\+/\t/
Stop vim wrapping sentences in the middle of a word
:set linebreak
I like to tweak the syntax highlighting and comment colours in vim. Create or add to ~/.vimrc.
syntax on hi Comment ctermfg=darkgray
I also find it useful, when I'm working in lots of xterms, for vim to change the window title to the filename I'm editing. Add these lines to ~/.vimrc:
set titlestring=%f set title