zefei / vim-wintabs

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

Support displaying vimtabs when statusline display is enabled #49

Closed tmandry closed 5 years ago

tmandry commented 5 years ago

When g:wintabs_display is set to statusline, I'd like a way to surface the vimtabs display as part of the tabline. Currently, vimtabs are not displayed anywhere.

More specifically, I'm using airline and can add a custom addition to the statusline (I'm okay with doing some configuring work). Not sure if this is possible, but I'd like a function I can call to render the vimtabs display (customized with g:wintabs_ui_vimtab_name_format, in my case) inside of airline. Is it possible?

P.S. Thanks for your great extension, it's exactly what I've been looking for!

zefei commented 5 years ago

I added the vimtabs fragment as a publicly accessible function: wintabs#ui#get_vimtabs_fragment().

I'm not too sure how well it works with airline, as this fragment contains highlight groups and some other special tokens. If it doesn't work, you'll have to do some manual regex work to remove its special tokens. Do a quick :echo wintabs#ui#get_vimtabs_fragment() to see what it actually returns with your configuration.

You can see how I use it in my own vimrc: https://github.com/zefei/dotfiles/blob/master/.vimrc#L144-L162

tmandry commented 5 years ago

Thank you! I was able to get it working in airline, using their plugin API. Here's my vimrc.