I can't seem to find a predefined keyboard shortcut for switching between open tabs in Gvim. What is it, and if there is none, how can I define one?
4 Answers
Use gt
and gT
commands.
:tabn
and :tabp
also work.
Read :help gt
and read that section completely. There are many useful commands explained there.
-
2
-
If I know that the command is
gt
it is easy to use the help. But how can I find a suitable command to "open a new tab" using Vim's help?:help tab
doesn't help... Oct 21, 2013 at 17:52 -
2@SebastianG Use
:helpgrep
to search for text in help files with a regular expression. For this particular problem, I would have used:helpgrep \<next\ tab\>
. For your particular problem of opening a new tab, I would use:helpgrep \<new\ tab\>
. See:help help
to see the various wayshelp
can help you. Oct 23, 2013 at 9:03 -
Press gt
to switch tabs. Also - 1gt
2gt
to open 1st, 2nd... tab.
-
I usually have just two tabs (code, test). So this is the fastest for me.– rpattabiSep 13, 2014 at 10:46
I have these mappings in my vimrc:
map <C-Left> <Esc>:tabprev<CR>
map <C-Right> <Esc>:tabnext<CR>
map <C-n> <Esc>:tabnew
I'm by no means a pro vim'er, but it works for me so I thought I'd share :) Control+Right for next tab, Control+Left for previous, Control+n to open a new tab (left out the so you can specify the path to open in the new tab).
-
-
-
1Mac users: you may need to disable the default Mission Control spaces keyboard shortcuts: stackoverflow.com/questions/15719135/…– 4Z4T4RAug 29, 2017 at 22:53
C-<PageUp>
C-<PageDown>
These are predefined, altaught not very practical, as on most keyboards Page keys are placed in the corners, far from 'natural' hands position.
-
1I use xfce4-terminal which has C-<PageUp/PageDown> defined to switch the terminal tabs. Also not very practicable. Jan 20, 2014 at 9:58