dotfiles/nvim/lua/custom/plugins/goto-preview.lua

19 lines
986 B
Lua

-- A small Neovim plugin for previewing native LSP's goto definition, type definition,
-- implementation, declaration and references calls in floating windows.
-- https://github.com/rmagatti/goto-preview
return {
'rmagatti/goto-preview',
event = 'VeryLazy',
config = function()
require('goto-preview').setup()
end,
keys = {
{ '<leader>pd', '<cmd>lua require("goto-preview").goto_preview_definition()<CR>', desc = 'Definition' },
{ '<leader>pt', '<cmd>lua require("goto-preview").goto_preview_type()<CR>', desc = 'Type' },
{ '<leader>pi', '<cmd>lua require("goto-preview").goto_preview_implementation()<CR>', desc = 'Implementation' },
{ '<leader>pD', '<cmd>lua require("goto-preview").goto_preview_declaration()<CR>', desc = 'Declaration' },
{ '<leader>pr', '<cmd>lua require("goto-preview").goto_preview_references()<CR>', desc = 'References' },
{ '<leader>pq', '<cmd>lua require("goto-preview").close_all_win()<CR>', desc = 'Close all' },
},
}