简体   繁体   中英

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

By default shows gvim in my tabs: the names of files. 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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