2023-12-03 07:58:27 -07:00
|
|
|
-- use treesitter over syntax (for highlighted code blocks)
|
|
|
|
vim.treesitter.start()
|
|
|
|
|
|
|
|
-- add custom highlights for list in `:h highlight-groups`
|
2023-12-18 08:49:44 -07:00
|
|
|
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]+' },
|
|
|
|
})
|
2023-09-08 06:05:35 -07:00
|
|
|
end
|
2024-06-08 01:49:15 -07:00
|
|
|
|
|
|
|
vim.keymap.set('n', 'gO', function()
|
|
|
|
require('vim.vimhelp').show_toc()
|
|
|
|
end, { buffer = 0, silent = true })
|
2024-07-01 02:48:09 -07:00
|
|
|
|
|
|
|
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | nunmap <buffer> gO'
|