Vim Tips
Pull the Word under the Cursor into a Command Line
I'm always forgetting this one...
use CTRL-R CTRL-W to pull the word under the cursor into the Vim command line, useful for searching etc.
Open a file with the cursor positioned on a specific line
This is a really handy tip for those occasions when you want to make a quick edit and you know the line number you're interested in:
matason$ vim +92 sites/default/settings.php
...will open settings.php with the cursor positioned at line 92
It also works when opening tabs:
:tabnew +92 sites/default/settings.php
and splitting:
:vsp +92 sites/default/settings.php
Increment/decrement number under the cursor
To increment:
CTRL+A
To decrement:
CTRL+X
Highlight all lines that don't begin with a certain character, # in the following example but contain some text:
/^[^#].\+$

Add new comment