Add useful shortcuts

This commit is contained in:
Anthony Rose 2024-12-04 13:05:49 +00:00
parent c4bc87d310
commit 13d3559a63

View file

@ -13,4 +13,25 @@ end
require'lspconfig'.gopls.setup{} require'lspconfig'.gopls.setup{}
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { silent = true }) -- None of this should be needed from 0.11.0 (except maybe gd).
do
vim.keymap.set('n', 'gd', function()
vim.lsp.buf.definition()
end, { desc = 'vim.lsp.buf.definition()' })
vim.keymap.set('n', 'grn', function()
vim.lsp.buf.rename()
end, { desc = 'vim.lsp.buf.rename()' })
vim.keymap.set({ 'n', 'x' }, 'gra', function()
vim.lsp.buf.code_action()
end, { desc = 'vim.lsp.buf.code_action()' })
vim.keymap.set('n', 'grr', function()
vim.lsp.buf.references()
end, { desc = 'vim.lsp.buf.references()' })
vim.keymap.set('i', '<C-S>', function()
vim.lsp.buf.signature_help()
end, { desc = 'vim.lsp.buf.signature_help()' })
end