nvim-syntax-info is a plugin that displays syntax information (highlight-groups) with nvim_buf_set_virtual_text
.
Displays the highlight group at the cursor position as shown below.
return synIDattr(a:synid, 'name') base=vimNotFunc, linked=Statement
|__ cursor here. |_______________________________|
virtual text
It will help you customize your colorscheme and make your own colorscheme!
Follow the package manager installation method you are using.
Here is an example with vim-plug.
Plug 'wadackel/nvim-syntax-info'
See also :h nvim-syntax-info.
Displays syntax information (virtual text) at the cursor position.
Clear syntax information (virtual text) at the cursor position.
Syntax information is displayed automatically when the cursor is moved.
Disables display with cursor movement.
Switch whether to display syntax information by moving the cursor.
It does not provide a default mapping. Let's set your mapping using the following keys.
<Plug>(syntax-info)
<Plug>(syntax-info-clear)
<Plug>(syntax-info-enable)
<Plug>(syntax-info-disable)
<Plug>(syntax-info-toggle)
For example:
nmap <silent> <Space>si <Plug>(syntax-info-toggle)
You can specify the content to be displayed in virtual text in the format of %KEY_NAME%
.
Key | Description |
---|---|
base | Directly applied highlight group name. |
linked | Linked highlight group name. |
Specify the delay millisecond when displaying by moving the cursor.
The highlight for syntax infomation in virtual text.
Default:
highlight link SyntaxInfo Comment