切换到 VIM 中的特定选项卡
我试图在 VIM 中从一个选项卡切换到另一个选项卡(可能与前一个选项卡不相邻)。是否有任何快捷方式,例如我们有 Ctrl-p/Ctrl-n 用于切换到相邻选项卡?
另外,我试图编写一个键映射,它将一个变量作为函数的输入并执行操作。例如,假设我按 Ctrl-5 ,一个函数(由用户编写)将被调用并作为输入 5 给出,光标将转到选项卡 5 (如果有任何第五个选项卡打开)。
您能建议如何做到这一点吗?
I was trying to switch from a tab to another tab (which may not be adjacent to the previous tab) in VIM. Is there any shortcut for that, like we have Ctrl-p/Ctrl-n for switching to adjacent tabs?
Also, I was trying to write a key mapping which will give a variable as input to a function and do the operation. For instance, let's say I press Ctrl-5 and a function (written by the user) will be called and given as input 5, and the cursor will go to tab 5 (if there is any 5th tab opened).
Can you please suggest how this can be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
5gt
切换到选项卡 5您还可以将其绑定到一个键:(
对于某些终端,映射
Ctrl-
可能不同/不可能。然后考虑Alt-
)use
5gt
to switch to tab 5you can also bind it to a key:
(Mapping
Ctrl-<number>
could be different/impossible for some terminals. ConsiderAlt-<number>
then)仅解决您的第一个问题,并引用 vim 中的
help tabs
:即,输入
3gt
转到第三个选项卡,3gT
返回 3 个选项卡从当前选项卡。Tackling only your first question, and quoting from
help tabs
in vim:ie, typing
3gt
goes to the third tab,3gT
goes 3 tabs back from the current tab.只是为了共享直接跳转到特定选项卡的键映射。请将它们放入 _vimrc 并使其工作。
Just for sharing the key mapping to jump into particular tab directly. Please put them into _vimrc and make it work.