Public Access
better hover
This commit is contained in:
+4
-9
@@ -10,15 +10,10 @@ for _, mode in ipairs({ "n", "v" }) do
|
||||
map(mode, "k", "gk", silent)
|
||||
end
|
||||
|
||||
-- Hover: diagnostics on current line if any, else LSP hover
|
||||
map("n", "K", function()
|
||||
local line = vim.api.nvim_win_get_cursor(0)[1] - 1
|
||||
if #vim.diagnostic.get(0, { lnum = line }) > 0 then
|
||||
vim.diagnostic.open_float()
|
||||
else
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end, { desc = "Hover (diagnostic or LSP)" })
|
||||
-- Hover: cycle diagnostics on the current line, then LSP hover. <CR> enters.
|
||||
local hover = require("hover")
|
||||
map("n", "K", hover.hover, { desc = "Hover (cycle diagnostics / LSP)" })
|
||||
map("n", "<CR>", hover.enter, { desc = "Enter hover window", silent = true })
|
||||
|
||||
-- LSP
|
||||
map("n", "<leader>gf",
|
||||
|
||||
Reference in New Issue
Block a user