mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(lsp): add 'reuse_win' for reuse window in lsp definition keymap
This commit is contained in:
parent
8c0e39c826
commit
91d304cb3b
1 changed files with 5 additions and 3 deletions
|
|
@ -5,6 +5,8 @@ M._keys = nil
|
|||
|
||||
---@return (LazyKeys|{has?:string})[]
|
||||
function M.get()
|
||||
local telescope = require("telescope.builtin")
|
||||
|
||||
local format = function()
|
||||
require("lazyvim.plugins.lsp.format").format({ force = true })
|
||||
end
|
||||
|
|
@ -14,11 +16,11 @@ function M.get()
|
|||
M._keys = {
|
||||
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition", has = "definition" },
|
||||
{ "gd", function() telescope.lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
||||
{ "gy", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto T[y]pe Definition" },
|
||||
{ "gI", function() telescope.lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" },
|
||||
{ "gy", function() telescope.lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" },
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue