Switch between tabs in NERDTree

I just started using the vim NERDTree plugin for my project.

I can not find the documentation for switching between open tabs. Can someone tell me the shortcut key [s]?

Thank...

+80
vim nerdtree
Mar 09 '10 at 22:18
source share
8 answers

An additional option (and my personal choice) beyond those listed by Michael Madsen:

gt = next tab

gt = previous tab

+150
Mar 09 '10 at 22:33
source share

I like to bind vim navigation keys to switch between tabs. Here are the lines from my .vimrc file:

 map <Cl> :tabn<CR> map <Ch> :tabp<CR> map <Cn> :tabnew<CR> 

This way, I can switch between tabs using the left and right buttons, just like I usually moved the cursor, except that I just hold the Control key.

  • Control + l goes to the next tab
  • Control + h moves to the previous tab
  • Control + n creates a new tab
+32
Mar 10 '10 at 6:15
source share

Quick check :h tabs shows CTRL - Page Down to cycle through tabs. You can also use the command :tabnext ( :tabn for short).

+12
Mar 09 '10 at 22:25
source share

I use iTerm on mac and I like to switch to next / previous tabs using Shift - [left arrow] and Shift - [right arrow]

From my .vimrc, here's how to do the same in MacVim;

  map <S-Right> :tabn<CR> map <S-Left> :tabp<CR> 

FYI, by default, Cmd-Shift- [and Cmd-Shift-] key combos will switch between tabs in MacVim (and in Google Chrome, Safari, and possibly with a number of other things)

+8
Nov 15 '12 at 13:03
source share

Adding digitalronin to the answers, I think that the main browser shortcut (at least in Chrome and Firefox) for switching tabs is the option + command + right or left arrow.

If you want your NERDTree Vim setup to fit this, then this option will work.

  map <DA-Right> :tabn<CR> map <DA-Left> :tabp<CR> 
+3
Feb 07 '13 at 0:24
source share

my settings

 map <F2> :NERDTreeToggle<cr> map <C-Right> :tabn<cr> map <C-Left> :tabp<cr> 
+3
Nov 14 '13 at 20:05
source share

To enable navigation in Tab, for example firefox, add this to your vimrc:

 nnoremap <CS-tab> :tabprevious<CR> nnoremap <C-tab> :tabnext<CR> nnoremap <Ct> :tabnew<CR> inoremap <CS-tab> <Esc>:tabprevious<CR>i inoremap <C-tab> <Esc>:tabnext<CR>i inoremap <Ct> <Esc>:tabnew<CR> inoremap <CSw> <Esc>:tabclose<CR> 

It is also useful. Use <A-Fn> to go to the nth tab

 nnoremap <A-F1> 1gt nnoremap <A-F2> 2gt nnoremap <A-F3> 3gt nnoremap <A-F4> 4gt nnoremap <A-F5> 5gt nnoremap <A-F6> 6gt nnoremap <A-F7> 7gt nnoremap <A-F8> 8gt nnoremap <A-F9> 9gt nnoremap <A-F10> 10gt 

Where

  C --> ctrl key S --> Shift key A --> Alt key F1-10 --> Are the function keys 

NOTE: Alt + f4 is usually used to close windows. So check this out. If the problem persists, you can always display Ctrl or Shift instead of Alt, or use a combination of them.

+3
Oct 21 '14 at 2:47
source share

'{TabNumber} + gt' will allow you to switch to the {TabNumber} tab.

For example, going to tab 1 will include "1" and then "g" and "t".

The tab number is incremented from 1 from left to right.

0
May 11 '17 at 12:04
source share



All Articles