0

I have such binding that opens the hover window

vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)

As you can see the background color of the let name2: {unknown} is white (#ffffff). I would like to make it transparent

enter image description here

How can I change the background color of the text?

P.S. I use Lua as a configuration language

3

1 Answer 1

0

That should be controlled by the NormalFloat highlight group. I have the following setting in Lua to make it "transparent" (same color as the buffer background):

local set_hl_for_floating_window = function()
  vim.api.nvim_set_hl(0, 'NormalFloat', {
    link = 'Normal',
  })
  vim.api.nvim_set_hl(0, 'FloatBorder', {
    bg = 'none',
  })
end

set_hl_for_floating_window()

vim.api.nvim_create_autocmd('ColorScheme', {
  pattern = '*',
  desc = 'Avoid overwritten by loading color schemes later',
  callback = set_hl_for_floating_window,
})

1
  • Thanks, I will try it as soon as possible and get back to you with feedback Dec 9, 2022 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.