Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I open several files using vim+tabf, switching across the files will involve using tabp & tabn.

Can I have a quicker way to do so?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

In vim you can replace any command with a shortcut key sequence. For tabp and tabp you might want to use ctrl-k and ctrl-j. To create that mapping you would add the following to your .vimrc:

nmap <C-k> :tabn<cr>
nmap <C-j> :tabp<cr>
share|improve this answer
    
Thank you very much! –  xiaohan2012 Oct 7 '12 at 6:18

By default, vim maps gt to :tabn and gT to :tabp - this can be useful if you're logged into a server without your vimrc on it, or if you are logged in as root on a machine other people have to use.

But when I do have my vimrc, I use <C-h> and <C-l> for switching tabs.

share|improve this answer
    
Thanks you for sharing –  xiaohan2012 Oct 7 '12 at 12:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.