diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-12-18 16:49:44 +0100 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-12-20 18:58:40 +0100 |
commit | cc6a257c8cad8051b6f7e9287249293ab0a929d9 (patch) | |
tree | cfdebdcd4b040be345cf035f13a242114db4747b /runtime/ftplugin/help.lua | |
parent | db4b0aeb928461a058e59969e07df886cbd990c1 (diff) | |
download | rneovim-cc6a257c8cad8051b6f7e9287249293ab0a929d9.tar.gz rneovim-cc6a257c8cad8051b6f7e9287249293ab0a929d9.tar.bz2 rneovim-cc6a257c8cad8051b6f7e9287249293ab0a929d9.zip |
docs: apply current colorscheme to default highlight groups
Problem: Not all default highlight groups show their actual colors.
Solution: Refactor `vimhelp.lua` and apply it to all relevant lists (UI
groups, syntax groups, treesitter groups, LSP groups, diagnostic groups).
Diffstat (limited to 'runtime/ftplugin/help.lua')
-rw-r--r-- | runtime/ftplugin/help.lua | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index bf3408c2d9..67c417b1be 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -2,6 +2,27 @@ vim.treesitter.start() -- add custom highlights for list in `:h highlight-groups` -if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then - require('vim.vimhelp').highlight_groups() +local bufname = vim.fs.normalize(vim.api.nvim_buf_get_name(0)) +if vim.endswith(bufname, '/doc/syntax.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*group-name\*]], stop = '^======', match = '^(%w+)\t' }, + { start = [[\*highlight-groups\*]], stop = '^======', match = '^(%w+)\t' }, + }) +elseif vim.endswith(bufname, '/doc/treesitter.txt') then + require('vim.vimhelp').highlight_groups({ + { + start = [[\*treesitter-highlight-groups\*]], + stop = [[\*treesitter-highlight-spell\*]], + match = '^@[%w%p]+', + }, + }) +elseif vim.endswith(bufname, '/doc/diagnostic.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*diagnostic-highlights\*]], stop = '^======', match = '^(%w+)' }, + }) +elseif vim.endswith(bufname, '/doc/lsp.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*lsp-highlight\*]], stop = '^------', match = '^(%w+)' }, + { start = [[\*lsp-semantic-highlight\*]], stop = '^======', match = '^@[%w%p]+' }, + }) end |