Vim:垂直选项卡列表可以吗?
是否可以让 vim 的选项卡列表垂直显示在编辑器的左侧?
这真的很有帮助,但我还没有找到任何可以做到这一点的插件。 (我对谷歌很烂吗?)
Is it possible to have vim's tab list presented vertically on the left side of the editor?
It'd be really helpful, but I haven't managed find any plugins that can do this yet. (do i suck at google?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我同意兰迪关于选项卡使用的观点。但前段时间我也在寻找在 gvim 中添加垂直制表符的可能性。为此,您必须修改源。对于 gvim,这不是太多工作,因为 gtk_notebook 小部件用于选项卡。对于 vim 来说,这可能需要更多的工作。
你可以在这里找到我制作的补丁/黑客 。我评论了一些有关窗口高度的内容,并添加了一个水平盒和一个垂直盒以将 gui.tabline 放在我想要的位置(左侧)。我将标签长度设置为最大宽度以设置最大标签尺寸......
它符合我的需求,但它实际上只是一个黑客,并不打算很好地编程。
抱歉,它不是一个插件,也不适用于 vim,但如果您确实需要此功能,切换到 gvim 可能不会有太大区别。
I would agree with Randy about the use of tabs. But I also looked for the possibility to have vertical tabs in gvim some time ago. To do this you have to modify the sources. For gvim, it's not too much work since the gtk_notebook widget is used for the tabs. For vim, it might be quite some more work.
You can find the patch/hack I've made here. I commented some stuff regarding the height of the window, and added a hbox and a vbox to put the gui.tabline where I wanted it (on the left side). I set the label length to a maximum width to set a maximum tab size...
It fits my needs but it really is just a hack and doesn't intent to be nicely programmed.
I'm sorry, it's not a plugin and it does not apply to vim, but if you really need this feature, switching to gvim might not be too much of a difference.
在我看来,您似乎正在使用选项卡作为缓冲区。我礼貌地请您花一点时间阅读这个答案如果情况确实如此。我也强烈建议你改掉这个习惯。
但是,如果您确实为此目的使用选项卡,则可以通过发出
:ls
列出缓冲区来获得“垂直选项卡列表”。您还可以使用许多可用的缓冲区资源管理器插件之一。It seems to me as though you are using tabs as buffers. I'd politely ask that you take a second to read this answer if that is indeed the case. I'd also strongly urge you to change this habit.
However, if you are indeed using tabs for this purpose you could potentially get a 'vertical tab list' by issuing
:ls
to list the buffers. You could also use one of the many buffer explorer plugins that are available.如果使用 Gvim,那么您可以使用
:te Buffers
撕下 Buffers 菜单并将其定位为侧边栏。与选项卡不同,但足以作为用户界面的解决方法。
If using Gvim, then you could tearoff the Buffers menu using
:te Buffers
and position it as a sidebar.Not the same as tabs but could suffice as a user interface workaround.
您尝试过 缓冲器 吗?
安装后,它有一个命令
:BuffergatorTabsOpen
,该命令在垂直窗口中显示打开的选项卡...Did you try buffergator?
After you install it it has a command
:BuffergatorTabsOpen
that shows the open tabs in a vertical window...您还不知道,但您正在寻找的命令是
:tabs
。对于上下文:我几乎专门使用 gvim --remote-tab 来启动编辑器。我尝试了一下 Randy 的
:ls
,但在让 gvim 打开一两周后,列表最终被我已经:quit
的选项卡填满了。读完手册后,我发现了:tabs
。You don't know it yet, but command you're looking for is
:tabs
.For context: I use gvim --remote-tab almost exclusively to launch an editor. I tried Randy's
:ls
for a bit, but after leaving gvim open for a week or two, the list eventually got filled with cruft from tabs that I had already:quit
. After reading the manual, I found:tabs
.