zefei / vim-wintabs

Modern buffer manager for Vim
MIT License
325 stars 25 forks source link

Option to disable tabline if only one buffer is open #54

Closed astier closed 4 years ago

astier commented 4 years ago

Hi. I would like to display the wintabs in the tabline only if more than one buffer or tab is open. Is this possible? Thank you.

astier commented 4 years ago

Here is what I added to my vimrc to solve it:

au vimenter * if len(getbufinfo({'buflisted':1})) < 2 | se stal=1 | else | exe 'WintabsAllBuffers' | en
au filetype fzf,nerdtree if len(getbufinfo({'buflisted':1})) < 2 | se stal=1 | en
au bufadd,winenter * if len(getbufinfo({'buflisted':1})) > 1 | exe 'WintabsAllBuffers' | se stal=2 | en
au bufdelete * if len(getbufinfo({'buflisted':1})) < 3 | se stal=1 | en