Cambiar entre pestañas en NERDTree


Acabo de empezar a usar el plugin NERDTree vim para mi proyecto.

No puedo encontrar la documentación para cambiar entre pestañas abiertas. ¿Alguien puede decirme las teclas de acceso directo ?

Gracias...

Author: Pierz, 2010-03-10

8 answers

Una opción adicional (y mi elección personal)más allá de las enumeradas por Michael Madsen:

gt = siguiente pestaña

gT = pestaña anterior

 170
Author: Chad Birch,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-03-09 22:33:34

Me gusta enlazar mis teclas de navegación vim para cambiar entre pestañas. Aquí están las líneas de mi archivo .vimrc:

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

De esa manera, puedo cambiar entre pestañas usando los botones izquierdo y derecho como normalmente movería el cursor, excepto que solo mantengo la tecla Control también.

  • Control+l se mueve a la siguiente pestaña
  • Control+h mueve a la pestaña anterior
  • Control+n crea un nuevo tab
 32
Author: Brian Riehman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-03-10 06:15:24

Una comprobación rápida en :h tabs revela que es CTRL-Page Down para alternar entre pestañas. También puede usar el comando :tabnext (:tabn para abreviar).

 13
Author: Michael Madsen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-03-09 22:25:41

Uso iTerm en el mac, y me gusta poder cambiar a las pestañas siguiente/anterior usando Shift-[tecla de flecha izquierda] y Shift-[tecla de flecha derecha]

De mi .vimrc, aquí es cómo hacer lo mismo en MacVim;

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

Para su información, por defecto, los combos de teclas Cmd-Shift - [y Cmd-Shift -] cambiarán entre pestañas en MacVim (y en Google Chrome, Safari y probablemente un montón de otras cosas)

 8
Author: digitalronin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-11-15 13:03:13

Mis ajustes

map <F2> :NERDTreeToggle<cr>
map <C-Right> :tabn<cr>
map <C-Left> :tabp<cr>
 4
Author: iBet7o,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-14 20:05:49

Añadiendo a la respuesta de digitalronin, creo que el acceso directo principal del navegador (al menos en Chrome y Firefox) para cambiar de pestañas es opción+comando+flecha derecha o izquierda.

Si desea mantener su configuración de NERDTree Vim consistente con eso, entonces esta variación funcionaría.

 map <D-A-Right> :tabn<CR>
 map <D-A-Left>  :tabp<CR>
 3
Author: sq1020,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-02-07 00:24:44

Para habilitar la navegación por pestañas como firefox, agrega esto a tu 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>

También esto es útil Use <A-Fn> para ir a la enésima pestaña

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 

Donde

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

NOTA: Alt + f4 se usa generalmente para cerrar las ventanas. Así que revisa eso. Si el problema persiste, siempre puede asignar la tecla Ctrl o Mayús en lugar de la tecla Alt, o usar alguna combinación de estas.

 3
Author: Prabhat Kumar Singh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-21 14:47:55

'{TabNumber} + gt' le permitirá cambiar a tab {TabNumber}.

Por ejemplo, ir a la pestaña 1 será teclear '1' seguido de 'g' y 't'.

El número de tabulación es incremental de 1 de izquierda a derecha.

 2
Author: Xu Chen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-11 00:21:58