Switching between tabs in NERDTree

2019-03-07 11:24发布

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

I can't find the documentation for switching between opened tabs. Can anyone tell me the shortcut key[s] ?

Thanks...

标签: vim nerdtree
8条回答
相关推荐>>
2楼-- · 2019-03-07 11:40

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

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

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

FYI, by default, the key combos Cmd-Shift-[ and Cmd-Shift-] will switch between tabs in MacVim (and in Google Chrome, Safari and probably a bunch of other stuff)

查看更多
forever°为你锁心
3楼-- · 2019-03-07 11:49

To enable Tab navigation like firefox add this to your vimrc:

nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab>   :tabnext<CR>
nnoremap <C-t>     :tabnew<CR>
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
inoremap <C-tab>   <Esc>:tabnext<CR>i
inoremap <C-t>     <Esc>:tabnew<CR>
inoremap <C-S-w>   <Esc>:tabclose<CR>

Also this come in handy Use <A-Fn> to go to the nth tabpage

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 for closing of the windows. So check for that. If problem persists you can always map Ctrl or Shift key instead of Alt key, or use some combination of these.

查看更多
我命由我不由天
4楼-- · 2019-03-07 11:53

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

map  <C-l> :tabn<CR>
map  <C-h> :tabp<CR>
map  <C-n> :tabnew<CR>

That way, I can switch between tabs using the left and right buttons just like I normally would move the cursor, except I just hold the Control key as well.

  • Control+l moves to the next tab
  • Control+h moves to the previous tab
  • Control+n creates a new tab
查看更多
淡お忘
5楼-- · 2019-03-07 11:54

my settings

map <F2> :NERDTreeToggle<cr>
map <C-Right> :tabn<cr>
map <C-Left> :tabp<cr>
查看更多
我只想做你的唯一
6楼-- · 2019-03-07 11:57

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

gt = next tab

gT = previous tab

查看更多
爱情/是我丢掉的垃圾
7楼-- · 2019-03-07 11:58

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

For example, going to tab 1 will be keying '1' followed by 'g' and 't'.

The tab number is incremental from 1 left to right.

查看更多
登录 后发表回答