barbar.nvim
barbar.nvim copied to clipboard
Request : Rounded left and right separators
It would be nice if it had support for powerline rounded separators between buffers.
It's currently using this for icons:
let icons = extend({
\ 'bufferline_default_file': '',
\ 'bufferline_separator_active': '▎',
\ 'bufferline_separator_inactive': '▎',
\ 'bufferline_close_tab': '',
\ 'bufferline_close_tab_modified': '●',
\}, get(g:, 'icons', {})) "
However this is undocumented and therefore not supported currently. I haven't decided yet how to expose that but I guess it should rather be on the g:bufferline
dict rather than on a separate g:icons
dict. But I think it won't work for powerline separator because those one require logic to gather th fg/bg from the item after/before.
Did you have an example of how you'd want it to look? I've been checking the powerline separators and I don't feel that any of them would have an aesthetically pleasing result. I would maybe add a separator for #22, but for the moment I'm not inclined to add powerline separator in-between tabs. The infrastructure to do it is however in-place as I had to make a refactor for scrollable tabs, so I would accept a PR that doesn't increase complexity by too much.
Maybe he meant something like this (notice the statusline).
Did you have an example of how you'd want it to look? I've been checking the powerline separators and I don't feel that any of them would have an aesthetically pleasing result. I would maybe add a separator for #22, but for the moment I'm not inclined to add powerline separator in-between tabs. The infrastructure to do it is however in-place as I had to make a refactor for scrollable tabs, so I would accept a PR that doesn't increase complexity by too much.
Maybe he meant something like this (notice the statusline).
Yes that's exactly what I want. The unicode characters for rounded powerline separators are U+E0B6 and U+E0B4. So what I had in mind was to use U+E0B6 at the start of tabline and then to separate tabs with the U+E0B4 separator.
That screenshot does look nice, but it doesn't match exactly what you're describing. What you describe sounds like this:
And I'm still not convinced. I'm open to making things look nice, but I'd need detailed (and nice looking) diagrams. You can build an example with the terminal, eg:
export bg1=243 &&
export fg1=255 &&
echo -e "\x1b[38;5;${bg1}m\ue0b6\x1b[0;48;5;${bg1};38;5;${fg1}mtab 1\x1b[0;38;5;${bg1}m\ue0b4"
(refer to https://github.com/guns/xterm-color-table.vim for colors)
That screenshot does look nice, but it doesn't match exactly what you're describing. What you describe sounds like this:
And I'm still not convinced. I'm open to making things look nice, but I'd need detailed (and nice looking) diagrams. You can build an example with the terminal, eg:
export bg1=243 && export fg1=255 && echo -e "\x1b[38;5;${bg1}m\ue0b6\x1b[0;48;5;${bg1};38;5;${fg1}mtab 1\x1b[0;38;5;${bg1}m\ue0b4"
(refer to https://github.com/guns/xterm-color-table.vim for colors)
The screenshot you posted describes what I had in mind. Maybe you can add the option to customize the highlights of the background of the active and inactive tabs so somebody can tweak it to make it look nicer.
Sorry I still don't see it being beautiful, so I won't invest time in it :/ If anyone is interested and thinks they can make it look nice, I accept PRs.
@paradoxsupreme there's now an API for customizing icons. I suspect it will take some work to set up the highlight groups and icons but it should technically be possible now
See the linked PR above this comment for more info, as well as the :help
page which outlines how to change the icons
@paradoxsupreme there's now an API for customizing icons. I suspect it will take some work to set up the highlight groups and icons but it should technically be possible now
See the linked PR above this comment for more info, as well as the
:help
page which outlines how to change the icons
Nice ! good job man thanks. I will try it out!
Though I don't think it will be enough to reproduce the screenshot above
After trying for some time I think you might be right. The closing icons would need their own highlight group in order to make it look right with respect to the background.
In case anyone is interested, that change would be made in render.lua
on line 171. Probably something like:
closePrefix = namePrefix .. 'Close'
Defaults for these groups would also need to be added in autoload/bufferline/highlight.vim
Sorry I still don't see it being beautiful, so I won't invest time in it :/ If anyone is interested and thinks they can make it look nice, I accept PRs.
I think what he wants is like this (ignore the text):
Hi, I think this would be possible, if we added an option for different left and right separators, then we can easily pad in the glyphs and make it rounded. I think this would be fairly trivial and would allow for a high degree of customization. I know this issue had been dead for a long time. But if you're accepting PRs for this I would be happy to work on it!
@xinslu we'd be glad to have you work on this! You're right, it doesn't seem undoable, there just hasn't been interest in pushing it forward thus far. Feel free to open a PR
#386 adds the ability to specify left and right separators:
(The config in the image: here and here)
You can try it, but there may yet be changes before the final release. If you do, feel free to leave feedback.
Expect to tweak the default hl groups, since rounded/slanted characters have weird interactions compared to how normal characters get highlighted. Just type :hi Buffer
and hit your wildchar (see :h 'wildchar'
or :lua = string.char(vim.opt.wildchar:get())
) to look at the options available.
@Iron-E I was looking to create exactly this look, but was missing option for right separator. It would be very nice if we get this.
For those still watching this issue, see :h barbar-setup.icons.separator
in the latest master.
how to remove the highlight of this tab?
how to remove the highlight of this tab?
Are you using the preset
feature? Either way, look at the README and try using the information there (we have detailed info on all the highlight groups)