fix(mappings): use :help in vim/help filetypes when pressing K, :Man for others

This commit is contained in:
2025-02-11 18:08:33 +01:00
parent 45914637ac
commit e433ff0b23
+7 -1
View File
@@ -47,7 +47,13 @@ vim.keymap.set({"x"}, ">", ">gv")
-- Remove default mappings
vim.keymap.set("", "<C-LeftMouse>", "")
vim.keymap.set({ "n", }, "K", ':Man "*"<CR>')
vim.keymap.set('n', 'K', function()
if vim.bo.filetype == 'vim' or vim.bo.filetype == 'help' then
vim.cmd('help ' .. vim.fn.expand('<cword>'))
else
vim.cmd('Man ' .. vim.fn.expand('<cword>'))
end
end)
-- Remove right-click menu items
vim.cmd.aunmenu({ "PopUp.-1-", })