如何显示GVIM标签关闭按钮? [英] How to show tab close button in GVIM?
问题描述
请让我知道如何显示在窗口GVIM每个选项卡上的关闭按钮。
Please let me know how to show the close button on each tab in the GVIM window.
此外,我也喜欢知道,是有可能作出警告,如果我关闭一个多标签窗口GVIM?
Also I would likes to know, is it possible to make a warning if I am closing a multiple tab GVIM window?
推荐答案
的和'tabline'
选项可以包括%X
标记为关闭标签按钮,但只工作对于耳线的控制台版本。 :帮助而'guitablabel
明确规定:
Showing the close button
The 'tabline'
option can include a %X
marker for the close tab button, but that only works for the console version of the tab line. :help 'guitablabel'
explicitly states:
注意语法高亮不用于该选项。在%T和%X项目也被忽略。
Note that syntax highlighting is not used for the option. The %T and %X items are also ignored.
所以,从字面上得到你想要的,你必须切换到(丑陋)基于文本的标签符合
So, to literally get what you want, you'd have to switch to the (uglier) text-based tab line with
:set guioptions-=e
但要注意,使用鼠标(即使你可能喜欢通过网络浏览器选项卡的其他应用程序进行定制来表示)是Vim气馁。如果右键鼠标一个GUI选项卡标签上的按钮,点击,就可以或者也可以选择 |关闭标签页|
从弹出菜单中
(注意,多问的问题是在这里皱了皱眉,请分别问他们。)
我不认为这是可能的;还有就是你可以挂接到一个 VimLeave pre
事件,但它不能prevent的Vim收盘;动作(如:qall
)不能撤消。如果你是用来通过映射或命令总是关闭Vim,你可以覆盖的,包括在那里检查(使用 tabpagenr('$')→1
)。
I don't think this is possible; there is a VimLeavePre
event that you could hook into, but it cannot prevent the closing of Vim; the action (e.g. :qall!
) cannot be undone. If you are used to closing Vim always via a mapping or command, you could overwrite that and include a check in there (using tabpagenr('$') > 1
).
如果您担心失去你的窗口/标签的布局,而看一看的的Vim会话的(可自动在后台持续)。这将允许重新推出的Vim的previously打开的窗口。
If you're concerned with losing your window / tab layout, rather have a look at Vim sessions (which can be persisted automatically in the background). This will allow to re-launch Vim with the previously opened windows.
这篇关于如何显示GVIM标签关闭按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!