0

How do I display the list of all buffers in the tabline? I am using the lightline plugin, with the following settings in my .vimrc:

set showtabline=2
let g:lightline = { 'colorscheme': 'PaperColor' }
let g:lightline.tabline = {
            \ 'left': [ [ 'tabs' ] ],
            \ 'right': [ [ 'bufnum'] ] }
let g:lightline.separator = { 'left': '', 'right': '' }
let g:lightline.subseparator = {'left': '', 'right': '' }

I am only able to view one buffer name in the tabline at a time.

enter image description here

Swapping through the various buffers simply updates the name in the single available tab slot, like so:

enter image description here

Instead, I would like to display the buffer names simultaneously in the tabline, like the vim-buftabline plugin does here:

enter image description here

Is there anyway I can achieve this without installing additional plugins? Is this a lightline issue or a vim issue, i.e. what do I need to add to my .vimrc to solve this? I've scoured the docs for lightline and vim (:h setting-tabline, etc.) and couldn't figure out how to display all the buffers.

Thanks for reading

  • why not installing a plugin? You can possibly achieve something similar with a custom function, but that will be close to using a plugin. BTW: the vim-airline statusline comes with a function for that out of the box – Christian Brabandt Apr 9 at 12:29
  • As @ChristianBrabandt said, use vim-buftabline if you want its functionalities. By the way, this is not usual way vim tabline is supposed to be used. But that's another issue, don't mind it now. Just use vim-buftabline – klaus Apr 9 at 13:08
  • 1
    So, your problem is fixed? And here is the usage of tabpages I mentioned. Take a look when you are more comfortable with Vim. – klaus Apr 9 at 13:17
  • 1
    @klaus Yup, everything works as desired. And thanks, that link is exactly what I was looking for to learn more! – A is for Ambition Apr 9 at 13:31
  • 1
    @AisforAmbition, when terminal is redrawn, the whole terminal is redrawn, not just part of it. Maybe for some reason, airline needed more time to redraw, so you could notice the flash. Probably the reason is having a huge feature set, maybe. – klaus Apr 9 at 13:43

Your Answer

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

Browse other questions tagged or ask your own question.