简体   繁体   English

gvim:用键盘切换标签

[英]gvim: switching tabs with keyboard

I can't seem to find a predefined keyboard shortcut for switching between open tabs in Gvim. 我似乎找不到一个预定义的键盘快捷键,用于在Gvim中打开标签之间切换。 What is it, and if there is none, how can I define one? 它是什么,如果没有,我怎么定义一个?

Use gt and gT commands. 使用gtgT命令。

:tabn and :tabp also work. :tabn:tabp也可以。

Read :help gt and read that section completely. 阅读:help gt并完整阅读该部分。 There are many useful commands explained there. 那里解释了许多有用的命令。

Press gt to switch tabs. gt切换标签。 Also - 1gt 2gt to open 1st, 2nd... tab. 此外 - 1gt 2gt打开第1,第2 ...标签。

I have these mappings in my vimrc: 我在我的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). 我不是一个专业的vim'er,但它对我有用,所以我想我会分享:) Control +右下一个标签,Control + Left for previous,Control + n打开一个新标签(左边所以你可以在新标签中指定要打开的路径)。

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. 这些都是预定义的,并不是很实用,因为在大多数键盘上,Page键被放置在角落里,远离“自然”的手位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM