fix(mappings): change hover/signature_help mappings to K/<C-S>
This commit is contained in:
@@ -157,3 +157,12 @@ vim.api.nvim_create_autocmd("TermLeave", {
|
|||||||
vim.cmd.checktime()
|
vim.cmd.checktime()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "vim", "help" },
|
||||||
|
callback = function(args)
|
||||||
|
vim.keymap.set("n", "K", function()
|
||||||
|
vim.cmd("help " .. vim.fn.expand("<cexpr>"))
|
||||||
|
end, { buffer = args.buf })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -94,13 +94,6 @@ vim.keymap.set({ "x" }, ">", ">gv")
|
|||||||
-- Remove default mappings
|
-- Remove default mappings
|
||||||
vim.keymap.set("", "<C-LeftMouse>", "")
|
vim.keymap.set("", "<C-LeftMouse>", "")
|
||||||
vim.keymap.set("n", "gr", "<Nop>")
|
vim.keymap.set("n", "gr", "<Nop>")
|
||||||
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
|
-- Remove right-click menu items
|
||||||
vim.cmd.aunmenu({ "PopUp.-1-" })
|
vim.cmd.aunmenu({ "PopUp.-1-" })
|
||||||
|
|||||||
+4
-4
@@ -42,15 +42,15 @@ function Keymap.set_defaults(bufnr)
|
|||||||
},
|
},
|
||||||
{ mode = { "n" }, lhs = "gD", rhs = vim.lsp.buf.declaration },
|
{ mode = { "n" }, lhs = "gD", rhs = vim.lsp.buf.declaration },
|
||||||
{
|
{
|
||||||
mode = { "n", "i" },
|
mode = "n",
|
||||||
lhs = "<C-k>",
|
lhs = "K",
|
||||||
rhs = function()
|
rhs = function()
|
||||||
vim.lsp.buf.hover({ border = "rounded", max_width = 80 })
|
vim.lsp.buf.hover({ border = "rounded", max_width = 80 })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
mode = { "n", "i" },
|
mode = "i",
|
||||||
lhs = "<C-j>",
|
lhs = "<C-s>",
|
||||||
rhs = function()
|
rhs = function()
|
||||||
vim.lsp.buf.signature_help({
|
vim.lsp.buf.signature_help({
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
|
|||||||
Reference in New Issue
Block a user