How to configure floating window colors/highlighting in 0.8?

Arch Linux updated to 0.8.0 and it made all my floating windows completely pink as well as closing parenthesis being highlighted for no reason. The issue is there regardless of using simple or 24bit colors. Problem persists even with minimal config with only Telescope standard configured import to test with.

Looking around there does not seem to be a very clear explanation of how to fix it, with some old APIS being changed and so i thought i should ask someone here how one in theory is supposed to have the following configured together:

  • vim.opt.termguicolors = true
  • alacritty terminal while respecting its theme
  • tmux

So far i’ve been using simple colors because of always having issues with setting up 24bit true colors. I would be very very happy if someone could point me to a working 0.8.0 setup with reasonable looking floating windows inside tmux using alacritty terminal. It would be nice if the floating windows would simply use the same theme as normally without separate configuration.

I do not seem to have any tmux issues and from what i can tell termguicolors seems to work just fine both inside and outside tmux except for the closing parenthesis highlighting.

True color sample image:


Simple color sample image with minimal (telescope only) config:
(could not add this yet since being new user, can add on request. To describe how it looks, it is violet instead of pink and a bit more readable but still terrible in comparison to what i had yesterday using 0.7.2 without changing any configs)

Many thanks in advance for any guidance on this. I could dig more into it but i have a feeling that there has to be more up to date information out there on how to have nice colors in neovim without ugly hacks.

Found a way to quickly fix for anyone interested:

vim.api.nvim_set_hl(0, “FloatBorder”, {bg=“#3B4252”, fg=“#5E81AC”})
vim.api.nvim_set_hl(0, “NormalFloat”, {bg=“#3B4252”})
vim.api.nvim_set_hl(0, “TelescopeNormal”, {bg=“#3B4252”})
vim.api.nvim_set_hl(0, “TelescopeBorder”, {bg=“#3B4252”})

Still wondering why i need to set these manually all of a sudden. And to clarify, the closing parenthesis highlight seems to happen only in my init.vim inside lua block so not such a big deal if i just manage to switch over to using lua for Plug. Looks like this now:

2 Likes

Thanks for sharing @jweckman !

I had to replace the quotes with single quotes to make it work for me.

vim.api.nvim_set_hl(0, 'FloatBorder', {bg='#3B4252', fg='#5E81AC'})
vim.api.nvim_set_hl(0, 'NormalFloat', {bg='#3B4252'})
vim.api.nvim_set_hl(0, 'TelescopeNormal', {bg='#3B4252'})
vim.api.nvim_set_hl(0, 'TelescopeBorder', {bg='#3B4252'})

Probably related to Notice of Breaking Changes · Issue #2293 · nvim-treesitter/nvim-treesitter · GitHub

#3656 removed the obsolete TS* highlighting groups. Users and plugins should instead directly use the capture name as a highlight group. E.g., instead of

hi link TSPunctDelimit Delimiter

do

hi link @punctuation.delimiter Delimiter

Nvim-treesitter now requires Nvim 0.8.0 or higher.

Probably you are using a color scheme that hasen’t added support for the for the new nvim-treesitter highlight groups.

Thanks for the details. After changing to a new default 0.8.1 color scheme i don’t seem to need to set any of the background colors anymore. No problems at all with true colors on now!

Case closed.