Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

WIP: nvim_set_hl #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

WIP: nvim_set_hl #96

wants to merge 1 commit into from

Conversation

nanotee
Copy link
Owner

@nanotee nanotee commented Feb 4, 2022

closes #47

@clason
Copy link

clason commented Apr 17, 2022

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update "defining syntax/highlights"
2 participants