简体   繁体   English

gvim在所有选项卡(甚至是当前选项卡)中显示文件路径

[英]gvim to show file path in all the tabs (even current one)

By default shows gvim in my tabs: the names of files. 默认情况下,我的选项卡中显示gvim:文件名。 They're however shown in a way like this: 但是,它们以如下方式显示:

  • if is in the same as the currently opened tab/buffer => no path shown (only file name) 如果与当前打开的选项卡/缓冲区相同,则=>没有显示路径(仅文件名)
  • otherwise abbreviated path and file name are shown 否则,将显示缩写的路径和文件名

however when I change the tab this causes tab names to change and brings me quite some confusion. 但是,当我更改选项卡时,这会导致选项卡名称更改并给我带来一些混乱。

Any chance to have it constantly going for: abbreviated path and file name are shown? 是否有机会不断使用它:显示缩写的路径和文件名?

I've seen following: 我看过以下内容:

:set guitablabel=%!expand(\"\%:t\")

however it goes the other way, so shows only file names on all the tabs (no path at all). 但是,反之则如此,因此在所有选项卡上仅显示文件名(根本没有路径)。

in http://objectmix.com/editors/148913-display-gvim-tabs.html http://objectmix.com/editors/148913-display-gvim-tabs.html中

How about this: 这个怎么样:

:set guitablabel=%!pathshorten(expand(\"\%:p\"))

This uses the :p filename-modifier to get the full absolute path, and then shortens the path via pathshorten() in the way it is usually done in the tab labels. 它使用:p filename-modifier来获取完整的绝对路径,然后通过pathshorten()缩短路径,方法通常是在标签标签中完成。

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

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