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

Shade floating terminal

Open AlexvZyl opened this issue 1 year ago • 3 comments

Hi, thanks for the cool plugin! Simple and adds a lot imo.

I am not sure if this is a limitation that is caused by neovim, but would it be possible to add shading_factor = <VALUE> to the floating terminal (float_opts)? It seems like it is using the normal background color.

AlexvZyl avatar Jul 19 '22 20:07 AlexvZyl

Hi @Alex-vZyl so the floating windows aren't shaded on purpose. Most people use them for things lazygit or top or terminal file managers. So shading would probably be disruptive in those circumstances, at least that has been my reasoning. It's possible to add, but to be completely honest I'm not particularly interested in adding this myself. Feel free to raise a PR if you're interested in making this happen though

akinsho avatar Jul 19 '22 20:07 akinsho

I understand that. I am relatively new to neovim plugins, but I will give it a shot.

AlexvZyl avatar Jul 19 '22 20:07 AlexvZyl

The terminal shading is added here

https://github.com/akinsho/toggleterm.nvim/blob/9db6f98af4f700945cff0f4f34b92ec80ab67a2b/lua/toggleterm/config.lua#L92

what I would suggest is that you implement this using shade_filetypes by allowing a new item to be added which is called float (not quite a filetype, that option needs to be renamed) and then you can check the conf.shade_filetypes in config.lua just above where I linked and if it includes float then similar to the other highlights you can add FloatNormal and FloatBorder to the overrides.

I think that should work.

akinsho avatar Jul 19 '22 20:07 akinsho

Going to close this out since I personally don't plan to do this, also a user can manually add a highlight for a float so this effect already be achieved

akinsho avatar Feb 28 '23 10:02 akinsho