Favorite VIM tips

From Devipedia

Jump to: navigation, search


Change the line endings in the view

:e ++ff=dos
:e ++ff=mac
:e ++ff=unix

Using the built-in regions to change text quickly

ci"    -> Cut everything inside "" string and start insert mode
da[    -> Delete the [] region around your cursor
vi'    -> Visual select everything inside '' string
ya(    -> Yank all text from ( to )

The command and type of region can all be used interchangeably and don't require .vimrc editing. See :help text-objects.

List all lines found in current and included files that contain the word under the cursor


To last place in jump list

Ctrl O

And then Ctrl I to jump back

Personal tools