mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
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).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user