toggleterm.nvim icon indicating copy to clipboard operation
toggleterm.nvim copied to clipboard

[Upstream] WinSeparator/VertSplit cannot be changed locally

Open Astrantia opened this issue 1 year ago • 11 comments

I would like to change the winhl of my toggleterm buffer, but it doesn't look to me this is possible now.

Astrantia avatar Jul 28 '22 20:07 Astrantia

@Astrantia you can change the highlights of the terminal by just using the highlights key for each terminal e.g.

    highlights = {
      Normal = { link = 'NormalFloat' },
    },

Since winhighlight is just about adding highlights, then you should be able to achieve whatever you want using those 🤷🏿‍♂️

akinsho avatar Jul 28 '22 20:07 akinsho

Please read the README for more details on how to use it

akinsho avatar Jul 28 '22 20:07 akinsho

@Astrantia you can change the highlights of the terminal by just using the highlights key for each terminal e.g.

    highlights = {
      Normal = { link = 'NormalFloat' },
    },

Since winhighlight is just about adding highlights, then you should be able to achieve whatever you want using those 🤷🏿‍♂️

require("toggleterm").setup({ 
    open_mapping = [[<c-\>]],
    highlights = {
        WinSeparator = { guibg = "#000000", guifg= "#000000" },
        VertSplit = { guibg = "#000000", guifg= "#000000" }
    },
})

doesn't seem to have any effect, be it with link or hex

Astrantia avatar Jul 28 '22 21:07 Astrantia

@Astrantia you can't set a window local WinSeparator as far as I can tell, I've tried adding one to toggleterm by default, but it doesn't work. You can try this yourself by running setlocal winhighlight=WinSeparator:Visual inside the toggleterm buffer or whatever buffer you'd like

akinsho avatar Jul 28 '22 21:07 akinsho

@Astrantia you can't set a window local WinSeparator as far as I can tell, I've tried adding one to toggleterm by default, but it doesn't work. You can try this yourself by running setlocal winhighlight=WinSeparator:Visual inside the toggleterm buffer or whatever buffer you'd like

Is nvim-tree using some different neovim way to present itself? they use WinSeparator over there https://github.com/kyazdani42/nvim-tree.lua/blob/64cc3c17e1a8d00d0fafcb61349b2a7d57234e53/lua/nvim-tree/view.lua#L38 and it seems to work for me too. As for why I'm interested in this is to make the split border disappear. Speaking of which https://user-images.githubusercontent.com/18753533/159889865-724becab-877b-45a2-898e-820afd6a4ee1.mov this gif demo doesn't seem to have that border at all, so I don't understand why it's only me with this white border hanging around above the terminal

Astrantia avatar Jul 28 '22 21:07 Astrantia

also nevermind the WinSeparator, shouldn't VertSplit have had an effect to style the border? (that's the reason i included both winseparator and vertsplit)

@Astrantia you can change the highlights of the terminal by just using the highlights key for each terminal e.g.

    highlights = {
      Normal = { link = 'NormalFloat' },
    },

Since winhighlight is just about adding highlights, then you should be able to achieve whatever you want using those 🤷🏿‍♂️

require("toggleterm").setup({ 
    open_mapping = [[<c-\>]],
    highlights = {
        WinSeparator = { guibg = "#000000", guifg= "#000000" },
        VertSplit = { guibg = "#000000", guifg= "#000000" }
    },
})

doesn't seem to have any effect, be it with link or hex

Astrantia avatar Jul 28 '22 21:07 Astrantia

The attached video doesn't work, FYI.

To clarify, in versions of neovim greater than 7.0 which is all that this plugin aims for since I don't support older neovim versions, VertSplit has been replaced by WinSeparator. I don't know what behaviour you are seeing in nvim-tree that looks like this is working, but a few very important points to clarify are:

  • what direction of toggleterm you are seeing?
  • where is the specific highlight you are trying to change?
  • what version of neovim you are on

Rather than what other plugins are doing, can you please just try the setlocal winhighlight=WinSeparator:Visual,VertSplit:Visual command and see if that produces any result for you.

akinsho avatar Jul 28 '22 21:07 akinsho

The attached video doesn't work, FYI.

To clarify, in versions of neovim greater than 7.0 which is all that this plugin aims for since I don't support older neovim versions, VertSplit has been replaced by WinSeparator. I don't know what behaviour you are seeing in nvim-tree that looks like this is working, but a few very important points to clarify are:

  • what direction of toggleterm you are seeing?
  • where is the specific highlight you are trying to change?
  • what version of neovim you are on

Rather than what other plugins are doing, can you please just try the setlocal winhighlight=WinSeparator:Visual,VertSplit:Visual command and see if that produces any result for you.

the video is one from the readme. i'm using nightly neovim so it should be good on that front.

i'm trying to specifically change the vertsplit for terminal only, and i'm using horizontal split for the terminal (lower half)

doing that setlocal command changes the background color of the terminal, but it doesn't get rid of the white split border.

basically doing :hi VertSplit guibg=#... guifg=#... achieves the result, but that also covers the highlighting of other splits

Astrantia avatar Jul 28 '22 21:07 Astrantia

image this is my neovim now and i want to blend in that white border with the rest of bg colors

Astrantia avatar Jul 28 '22 21:07 Astrantia

@Astrantia as I have already mentioned, this is something that I noticed as soon as WinSeparator was added. As far as I can tell there is an upstream neovim issue here since as you have already observed if you set WinSeparator via winhighlight it doesn't work anyway nor does VertSplit. Setting it globally like you mention with highlight (obv) works but is not the desired outcome. This is not a problem that I can fix here.

akinsho avatar Jul 28 '22 21:07 akinsho

@Astrantia as I have already mentioned, this is something that I noticed as soon as WinSeparator was added. As far as I can tell there is an upstream neovim issue here since as you have already observed if you set WinSeparator via winhighlight it doesn't work anyway nor does VertSplit. Setting it globally like you mention with highlight (obv) works but is not the desired outcome. This is not a problem that I can fix here.

I guess using a global highlight and winbars as a visual guide for separating buffers is something I can do for now. Feel free to close or keep this issue opened for an upstream reference

Astrantia avatar Jul 28 '22 21:07 Astrantia