Remove 'X' from Vim Tab Bar

Remove 'X' from Vim Tab Bar

When using multiple tabs in vim, there is a bar at the top displaying the tabs. At the far right of that bar there is an X. This is used to close the current tab if use of the mouse is enabled; however, I don't use the mouse in vim, so for me it is a bit of useless cruft taking up space.

With many tabs open, vim doesn't display the whole filename in each files, only the last few characters. Getting rid of this X -- and the small amount of empty space that seems to be reserved next to it -- would free up a little bit of space. I would be interested in a method to simply turn it invisible, but the ideal answer would give me a way to remove it entirely and free up this space.

4

2 Answers

The 'tabline' option allows you to define your preferred way to tab pages labels. This isn't easy, thus an example will be given here.

You'll find an example (that you can modify to exclude the X character) at :help setting-tabline.

Unfortunately the default Vim tabline is hardcoded in C and the X is defined there, as you can see in src/nvim/screen.c file.

The solution would be to recreate Vim's default tabline (or something close to it) using the syntax of the 'tabline' variable, and omit the X in there. You can find several possible implementations in the comments here.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.