nvim-lua-guide icon indicating copy to clipboard operation
nvim-lua-guide copied to clipboard

WIP: nvim_set_hl

Open nanotee opened this issue 3 years ago • 1 comments

closes #47

nanotee avatar Feb 04 '22 22:02 nanotee

With 0.7, you can now set highlights in pure Lua:

vim.api.nvim_set_hl(0, "Search", { fg = '#2E3440', bg = '#E2A478', bold = true })
vim.api.nvim_set_hl(0, "IncSearch", { link = "Search" })

(namespace 0 for the global highlight). Note: this completely replaces the highlight group (so {} clears it); to change a single attribute, you have to vim.api.nvim_get_hl_by_name("Search", true) it, change the desired key, and then hl_set it again.

The list of valid gui attributes are in :h synIDattr() (plus ctermfg, ctermbg, and cterm).

clason avatar Apr 17 '22 09:04 clason