From d86b137eb5bdb13ac525b4fd394ab15be8511bd6 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 4 Jul 2024 15:39:41 +0200 Subject: [PATCH] go to preview keys --- lua/custom/plugins/lsp.lua | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua index 31ea64f..084ccb5 100644 --- a/lua/custom/plugins/lsp.lua +++ b/lua/custom/plugins/lsp.lua @@ -300,8 +300,51 @@ return { { 'rmagatti/goto-preview', event = 'FileType', + keys = { + { + 'gpd', + function() + require('goto-preview').goto_preview_definition() + end, + desc = 'Go to definition preview', + }, + { + 'gpD', + function() + require('goto-preview').goto_preview_declaration() + end, + desc = 'Go to declaration preview', + }, + { + 'gpi', + function() + require('goto-preview').goto_preview_implementation() + end, + desc = 'Go to implementaion preview', + }, + { + 'gpt', + function() + require('goto-preview').goto_preview_type_definition() + end, + desc = 'Go to type preview', + }, + { + 'gpt', + function() + require('goto-preview').goto_preview_type_references() + end, + desc = 'Preview references', + }, + { + 'gpc', + function() + require('goto-preview').close_all_win() + end, + desc = 'Close all preview windows', + }, + }, config = function() - require('core.utils').load_mappings 'goto_preview' require('goto-preview').setup {} end, dependencies = 'nvim-telescope/telescope.nvim',