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.

  • Which operating system? – Daniel Beck Aug 18 '13 at 14:14
  • @DanielBeck Oh, sorry: Linux (Ubuntu 13.04), but I don't think that should matter since this is a internal thing to vim. The tab bar runs within the terminal window that I call vim in, it's not a function of the operating system's window manager or anything like that. – evilsoup Aug 18 '13 at 14:22
  • You are trying to save one character (that's all the X takes) in order to accomodate an inherently broken system. Not only saving only one character obviously won't help getting more readable tab names but tabs, in and off themselves are a very poor way to work with multiple buffers in Vim. Anyway, did you read :help setting-tabline? – romainl Aug 18 '13 at 14:31
  • Try working with buffers instead of tabs. – Roland Smith Aug 18 '13 at 18:56

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.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.