Sunday, November 29, 2009

mapping

mapping
Use mappings to save typing for things you frequently type. The first one below, when typing in insert mode, changes every occurence of ;so to System.out.println(); and leaves you in insert mode between the parentheses!

imap ;so System.out.println();
imap ;ne /;a
vmap ;bo "zdiz
The second one above, while in insert mode, moves you to the end of the next line when you type ;ne. The last one puts bold html tags around something you have visually selected.

These usually go in your .vimrc file. You can even have certain mappings loaded based on the type of file you are editing.

Quiz: what do these do? :)

nnoremap w
nnoremap W

map :noh:redraw!

No comments: