Thursday, July 17, 2008

Vim tip

In Emacs, you can use C-x-right or C-x-left to switch between buffers. Vim has the commands :bnext and :bprevious which do the same thing, which can be shortened to :bn and :bp. But with these lines in your .vimrc file:

map <C-Tab> :bn <CR>
map <C-S-Tab> :bp <CR>

you can use ctrl+tab and ctrl+shift+tab to switch between buffers. Nifty, eh?

Or better yet, how about this:

map <silent> <C-Tab> :bn! <CR>
map <silent> <C-S-Tab> :bp! <CR>

No comments:

Post a Comment