mirror of
https://github.com/neovim/neovim.git
synced 2026-06-15 16:23:48 +00:00
Problem:
The `:checkhealth` buffer uses the help syntax, so help tag links (e.g.
`|clipboard|`) are highlighted like they are in help buffers. However,
unlike in help buffers, `CTRL-]` doesn't jump to the relevant help file.
I expect that if the `:checkhealth` buffer looks like a help buffer,
then it should behave like one where it makes sense. This comment from
/r/neovim suggests that this was the intention:
https://www.reddit.com/r/neovim/comments/5ghv3r/see_clipboard_how/dascnry/.
Solution:
Set `'tags'` in `checkhealth` buffers so that `:tag` and friends look
for tags in the help tags files.
(cherry picked from commit c4285acb92)
25 lines
933 B
Lua
25 lines
933 B
Lua
vim.keymap.set('n', 'gO', function()
|
|
require('vim.treesitter._headings').show_toc(6)
|
|
end, { buf = 0, silent = true, desc = 'Show an Outline of the current buffer' })
|
|
|
|
vim.keymap.set('n', ']]', function()
|
|
require('vim.treesitter._headings').jump({ count = 1, level = 1 })
|
|
end, { buf = 0, silent = false, desc = 'Jump to next section' })
|
|
vim.keymap.set('n', '[[', function()
|
|
require('vim.treesitter._headings').jump({ count = -1, level = 1 })
|
|
end, { buf = 0, silent = false, desc = 'Jump to previous section' })
|
|
|
|
-- Look for tags in help tags files
|
|
vim.bo.tags = vim
|
|
.iter(vim.api.nvim_get_runtime_file('doc/tags doc/tags-??', true))
|
|
:map(vim.fn.fnameescape)
|
|
:map(function(path)
|
|
return vim.fn.escape(path, ',')
|
|
end)
|
|
:join(',')
|
|
|
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
|
|
.. '\n sil! exe "nunmap <buffer> gO"'
|
|
.. '\n sil! exe "nunmap <buffer> ]]" | sil! exe "nunmap <buffer> [["'
|
|
.. '\n setlocal tags<'
|