Friday, April 11, 2008

.vimrc key mappings

Tired of commenting and uncommenting lines of code in vim with long commands like :'a,'bs/#// and :'a,'bs/^/#/? Try key mappings.

:map <F5> <Esc> :'a,'bs/^/#/<CR>
:map
<F4> <Esc> :'a,'bs/#//<CR>

Type both lines into ~/.vimrc and save. Make sure to enter
<F5> and <F4> and as four characters each.

No comments: