import { nvim_set_hl } from "https://deno.land/x/denops_std@v6.4.0/function/nvim/mod.ts";
Sets a highlight group.
Note:
Unlike the :highlight
command which can update a highlight group,
this function completely replaces the definition. For example:
nvim_set_hl(0, 'Visual', {})
will clear the highlight group
'Visual'.
Note:
The fg and bg keys also accept the string values "fg"
or "bg"
which act as aliases to the corresponding foreground and background
values of the Normal group. If the Normal group has not been defined,
using these values results in an error.
Note:
If link
is used in combination with other attributes; only the
link
will take effect (see :hi-link
).
Parameters:
- {ns_id} Namespace id for this highlight
nvim_create_namespace()
. Use 0 to set a highlight group globally:highlight
. Highlights from non-global namespaces are not active by default, usenvim_set_hl_ns()
ornvim_win_set_hl_ns()
to activate them. - {name} Highlight group name, e.g. "ErrorMsg"
- {val} Highlight definition map, accepts the following keys:
- fg (or foreground): color name or "#RRGGBB", see note.
- bg (or background): color name or "#RRGGBB", see note.
- sp (or special): color name or "#RRGGBB"
- blend: integer between 0 and 100
- bold: boolean
- standout: boolean
- underline: boolean
- undercurl: boolean
- underdouble: boolean
- underdotted: boolean
- underdashed: boolean
- strikethrough: boolean
- italic: boolean
- reverse: boolean
- nocombine: boolean
- link: name of another highlight group to link to, see
:hi-link
. - default: Don't override existing definition:hi-default
- ctermfg: Sets foreground of cterm colorctermfg
- ctermbg: Sets background of cterm colorctermbg
- cterm: cterm attribute map, likehighlight-args
. If not set, cterm attributes will match those from the attribute map documented above.