I've been searching for the shortcut to switch tab when i'm in insertion mode. I know by pressing gT
or gt
for switching tab on visual mode. Is nerdTree already have this features or do I need to map the key for this?
Asked
Active
Viewed 354 times
-1

andhikaribrahim
- 341
- 6
- 24
-
2Don't switch tabs in insert mode, that's what normal mode is for. – romainl Feb 08 '17 at 10:29
-
Possible duplicate of [Switching between tabs in NERDTree](http://stackoverflow.com/questions/2413005/switching-between-tabs-in-nerdtree) – GiftZwergrapper Feb 08 '17 at 12:02
1 Answers
0
First, this has nothing to do with NERDTree. Tabs are a built-in feature of Vim. It may be more useful with NERDTree (as you open multiple locations in different tabs), though.
If you go to the :help
page of gt
, you'll see all alternative keys:
:tabn[ext] *:tabn* *:tabnext* *gt* <C-PageDown> *CTRL-<PageDown>* *<C-PageDown>* gt *i_CTRL-<PageDown>* *i_<C-PageDown>*
In Vim's help, the i_
prefix represents insert mode. So, the built-in mapping to switch tabs in insert mode is Ctrl + PageUp / PageDown.
If you want to use different keys, you can use mappings like the following:
inoremap <C-Tab> <C-\><C-N>:tabnext<CR>
inoremap <C-S-Tab> <C-\><C-N>:tabprevious<CR>

Ingo Karkat
- 167,457
- 16
- 250
- 324