1

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 '19 at 12:29
  • 1
    @ChristianBrabandt Airline was causing this weird flickering issue whenever I resized my terminal window, but yeah it worked perfectly other than that. You're right about just using a plugin. I eventually got everything working with github.com/mengelbrecht/lightline-bufferline – A is for Ambition Apr 9 '19 at 13:13
  • 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 '19 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 '19 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 '19 at 13:43
0

Try installing the lightline-bufferline plugin.

The README constains instructions on how to show buffers in lighline.

| improve this answer | |

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.