Wednesday, April 13, 2011

How to use tabs in Vim?

$ vim -p <filename1> <filename2> <filename3> = run a new vim instance with several files open as tabs 

:tabnew <filename> = open a new tab
:tabnext / :tabn = move to the next tab
:tabprevious / :tabp = move to the previous tab

In vimrc :tabnext and :tabprevious can be mapped to Ctrl+L and Ctrl+H...or to any other key combination.

map <C-L> :tabnext<CR>
map <C-H> :tabprevious<CR>

No comments: