diff options
Diffstat (limited to 'runtime/ftplugin/help.lua')
-rw-r--r-- | runtime/ftplugin/help.lua | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 4cc3386167..67c417b1be 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -1,3 +1,28 @@ -if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then - require('vim.vimhelp').highlight_groups() +-- use treesitter over syntax (for highlighted code blocks) +vim.treesitter.start() + +-- add custom highlights for list in `:h 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 |