From c4285acb925596c3be17ea94b32cd35a9376b70e Mon Sep 17 00:00:00 2001 From: Marcus Caisey Date: Mon, 11 May 2026 20:14:52 +0100 Subject: [PATCH] fix(health): set 'tags' for help filetype #39742 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. --- runtime/ftplugin/checkhealth.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/ftplugin/checkhealth.lua b/runtime/ftplugin/checkhealth.lua index a10c1dfdcb..74ee47b5f1 100644 --- a/runtime/ftplugin/checkhealth.lua +++ b/runtime/ftplugin/checkhealth.lua @@ -9,6 +9,16 @@ 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 gO"' .. '\n sil! exe "nunmap ]]" | sil! exe "nunmap [["' + .. '\n setlocal tags<'