vim

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:

Subscribe to RSS - vim