From 596f781e1ae994a2502db5b056453705be9a0210 Mon Sep 17 00:00:00 2001 From: David Work Date: Mon, 1 Dec 2025 17:44:46 +0900 Subject: [PATCH] Added jump to help tags from signature help menu --- remap.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/remap.lua b/remap.lua index c1d79bd..8dd3d6f 100644 --- a/remap.lua +++ b/remap.lua @@ -128,3 +128,29 @@ function AddLocListEntry() end vim.keymap.set("n", "la", AddLocListEntry, { desc = "[L]ocation list [a]ppend current line" }) +vim.api.nvim_create_autocmd("FileType", { + pattern = "help", + callback = function() + vim.schedule(function() + vim.keymap.set("n", "", function() + local word = vim.fn.expand('') + + -- Extract tag from |tag| format used in help files + local tag = word:match('|([^|]+)|') or word + + if tag then + -- Remove any trailing special characters + tag = tag:gsub('[^%w%-_*]', '') + + if tag ~= '' then + local success = pcall(vim.cmd, 'tag ' .. tag) + if not success then + -- Try fuzzy search + vim.cmd('tag /' .. tag) + end + end + end + end) + end) + end +})