If the full path of a file is very long, you can't tell which file is in a given tab. so I'm wondering is there is a way let the tab only display the file name rather than the full path of the file, might be convenient in some case.
If all that is wanted is to display the name of the current file, type Ctrl-G (or press 1 then Ctrl-G for the full path). When using @% , the name is displayed relative to the current directory. In insert mode, type Ctrl-R then % to insert the name of the current file.
To directly move to first tab or last tab, you can enter the following in command mode: :tabfirst or :tablast for first or last tab respectively. To move back and forth : :tabn for next tab and :tabp for previous tab. You can list all the open tabs using : :tabs. To open multiple files in tabs: $ vim -p source.
Vem Tabline is a lightweight Vim/Neovim plugin to display your tabs and buffers at the top of your screen using the editor's tabline. Vem tabline shows the list of open buffers to the left of the top line of the screen and tabs as numbered workspaces to the right.
Try
:set guitablabel=%t
For format of possible options see
:help 'statusline'
I have the following in my vimrc:
set guitablabel=\[%N\]\ %t\ %M
which outputs: [Number] Filename and + sign if a file is modified ([4] foo.html +). Number is very useful to immediate switch to the chosen tab with command [Number]gt (4gt if I want to jump to the file in the tab 4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With