Closed kafendt closed 6 years ago
Hey @kafendt,
Thank you for the PR. This looks like a really good addition and I would certainly like to have it in wintabs. Unfortunately like you said, currently this isn't in a mergable state. When I wrote wintabs, powerline/airline support was on my roadmap, but the huge complexity it brings to the tabs layout made me drop it. The main challenges for supporting this feature are:
Currently I don't have short term plans to add multi-byte character support to wintabs, but I may do it whenever I find opportunity. If you want to continue to evolve this PR, I'd suggest tackling another issue first: to allow separator or tab name to be multi-byte unicode. It's more clear how to test the correctness of that issue (total length of tabs is calculated correctly), and it's trivial to extend it to support powerline once its correctness is guaranteed.
To make this PR mergable, I'd like to have:
Again, thank you very much for putting time on this!
Hey sorry for the late reply, I am pretty busy at the moment. I agree with you, I mainly created the pull request to see whether there was interest in the feature at all. Now that I know there is I'll try to implement what you mentioned. It might take me a while though because I am currently still busy with a few other things, I will get back to you as soon as I am working on it again!
Thanks @zefei !
Hey @kafendt,
I did find opportunity to work on this issue lately, and I rewrote the renderer and layout functions to support multibyte characters. With the new renderer API (g:wintabs_renderers), your changes could be easily adopted to render powerline characters correctly.
I plan to move powerline support or other renderer features into separate plugins, so that the core wintabs options are not too many. Do you want to make your repo vim-wintabs-powerline standalone and containing only renderer functions? I can do that as well since I do plan to revamp wintabs a bit next month (will include your code, neovim mouse support, a few more utility commands).
Thanks!
Hey there, thats awesome I'd be happy to implement the changes. So, as I take it you want to have plugins to your plugin, right? My repo would then only contain functions that extend the base vim-wintabs, is that what you're going for? I could probably work on this again within the next month. If you'd prefer to keep all elements under one roof (your github account) that'd be fine by me too. Just let me know you plans :smiley:.
Hey @kafendt,
Yeah that's what I meant. I don't really need all repos under this account, but I'll probably still create another repo here, since I do want to make sure it reflects some basic designs of wintabs - having simple defaults that work with default highlight groups such as Tabline, TablineSel, etc. And leave further customizations to pull requests.
If I don't have time to do that within the next month, you can surely create the repo, and I'll change the doc and README to link to that.
@kafendt,
I've pushed a v0 for powerline font support in this repo: https://github.com/zefei/vim-wintabs-powerline. I haven't got enough time to put in docs or fully test it, but it should be functional enough. Let me know if you have any suggestions. Thanks!
This seems like a great feature!
This feature is now fully supported in vim-wintabs-powerline, so closing this PR. Thank you @kafendt for the work you did here!
Hey there, first of all I want to say thank you very much for this awesome plugin. It is in my opinion definitely the best tabs/buffer handling plugin out there :smile:. The only feature that was missing for me personally was support for powerline font, which I have tried to add. My changes add the following variables:
g:wintabs_use_powerline
This sets whether powerline fonts are used at all, if this is set to 0 nothing changes and the plugin will behave as it always has.g:wintabs_ui_powerline_sep_active_buffer_left
Defines the seperator symbol on the left side of the currently active buffer.g:wintabs_ui_powerline_sep_active_buffer_right
Defines the seperator symbol on the right side of the currently active buffer.g:wintabs_ui_powerline_sep_inbetween_buffer
Defines the seperator symbol that will be shown inbetween buffers.g:wintabs_ui_powerline_sep_rightmost_buffer
Defines the seperator symbol that will be at the far right of the buffer list.g:wintabs_ui_powerline_sep_active_tab_left
Defines the seperator symbol on the left of the currently active tab.g:wintabs_ui_powerline_sep_active_tab_right
Defines the seperator symbol on the left of the currently active tab.g:wintabs_ui_powerline_sep_inbetween_tab
Defines the seperator symbol that will be shown inbetween tabs.g:wintabs_ui_powerline_sep_leftmost_tab
Defines the seperator symbol that will be at the far left of the tabs list.g:wintabs_ui_active_buffer_higroup
The highlight group for the currently active buffer. (e.g. :g:wintabs_ui_active_buffer_higroup='WintabsActiveBuffer'
withhi! WintabsActiveBuffer cterm=NONE ctermbg=1 ctermfg=8 guibg=#009933 guifg=#000000
)g:wintabs_ui_active_buffer_changed_higroup
The highlight group for the currently active buffer when there are unsaved changes.12.
g:wintabs_ui_inactive_buffer_higroup
The highlight group for currently inactive buffers. (e.g.g:wintabs_ui_inactive_buffer_higroup='WintabsInactiveBuffer'
withlet s:linenr_bg_color = synIDattr(synIDtrans(hlID('LineNr')), 'bg', "gui")
let s:linenr_fg_color = synIDattr(synIDtrans(hlID('LineNr')), 'fg', "gui")
execute 'hi! WintabsInactiveBuffer cterm=NONE ctermbg=1 ctermfg=8 guibg='.s:linenr_bg_color.' guifg='.s:linenr_fg_color
Here is my current setup:
let g:wintabs_use_powerline = 1
let g:wintabs_ui_powerline_sep_active_buffer_left = "\ue0b4"
let g:wintabs_ui_powerline_sep_active_buffer_right = "\ue0b4"
let g:wintabs_ui_powerline_sep_inbetween_buffer = "\ue0b5"
let g:wintabs_ui_powerline_sep_rightmost_buffer = "\ue0b4"
let g:wintabs_ui_active_buffer_higroup = "WintabsActiveBuffer"
let g:wintabs_ui_active_buffer_changed_higroup = "WintabsActiveBufferChanged"
let g:wintabs_ui_inactive_buffer_higroup = "WintabsInactiveBuffer"
let g:wintabs_ui_active_tab_higroup = "WintabsActiveTab"
let g:wintabs_ui_inactive_tab_higroup = "WintabsInactiveTab"
let g:wintabs_ui_show_vimtab_name = 2
colorscheme solarized
(its important that the higroups are declared after this)let s:linenr_bg_color = synIDattr(synIDtrans(hlID('LineNr')), 'bg', "gui")
let s:linenr_fg_color = synIDattr(synIDtrans(hlID('LineNr')), 'fg', "gui")
execute 'hi! WintabsInactiveBuffer cterm=NONE ctermbg=1 ctermfg=8 guibg='.s:linenr_bg_color.' guifg='.s:linenr_fg_color
hi! WintabsActiveBuffer cterm=NONE ctermbg=1 ctermfg=8 guibg=#009933 guifg=#000000
hi! WintabsActiveBufferChanged cterm=NONE ctermbg=1 ctermfg=8 guibg=#f2b81e guifg=#000000
hi! WintabsActiveTab cterm=NONE ctermbg=1 ctermfg=8 guibg=#FFFFFF guifg=#000000
hi! WintabsInactiveTab cterm=NONE ctermbg=1 ctermfg=8 guibg=#073642 guifg=#586e75
Which ends up to look like this for an unmodified buffer:![screenshot from 2017-09-25 21 51 00](https://user-images.githubusercontent.com/12450485/30812470-5f74de98-a23d-11e7-950a-b7b4c6f28888.png)
And this for a modified buffer:![screenshot from 2017-09-25 21 53 49](https://user-images.githubusercontent.com/12450485/30812481-673d0d58-a23d-11e7-9d9e-7f7aad74a385.png)
A different possible look:![screenshot from 2017-09-26 10 42 32](https://user-images.githubusercontent.com/12450485/30840041-a8bdfcb4-a2a7-11e7-9ddb-719de95c99f6.png)
There are a couple of problems still:
I guess its not really in a mergable state right now but if you are interested in this feature I would try to fix the problems that still exist and add my changes to the docs. Just let me know what you think.