fix(keywordprg): use K for keywordprg, <C-k> for hover

This commit is contained in:
2026-05-08 20:59:42 +02:00
parent 1d5ab084ef
commit 51113e1907
3 changed files with 5 additions and 5 deletions
+2 -4
View File
@@ -155,11 +155,9 @@ vim.api.nvim_create_autocmd("TermLeave", {
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "vim", "help" }, pattern = { "lua" },
callback = function(args) callback = function(args)
vim.keymap.set("n", "K", function() vim.bo[args.buf].keywordprg = ":help!"
vim.cmd("help " .. vim.fn.expand("<cexpr>"))
end, { buffer = args.buf })
end, end,
}) })
+1 -1
View File
@@ -150,7 +150,7 @@ vim.keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1, float = true }) vim.diagnostic.jump({ count = 1, float = true })
end) end)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration) vim.keymap.set("n", "gD", vim.lsp.buf.declaration)
vim.keymap.set("n", "K", function() vim.keymap.set("n", "<C-k>", function()
vim.lsp.buf.hover({ max_width = 80 }) vim.lsp.buf.hover({ max_width = 80 })
end) end)
vim.keymap.set({ "i", "s" }, "<C-s>", function() vim.keymap.set({ "i", "s" }, "<C-s>", function()
+2
View File
@@ -67,6 +67,8 @@ local function on_attach(client, buf)
}) })
end, end,
}) })
pcall(vim.keymap.del, "n", "K", { buffer = buf })
end end
function M.setup() function M.setup()