Add useful shortcuts
This commit is contained in:
parent
c4bc87d310
commit
13d3559a63
1 changed files with 22 additions and 1 deletions
23
init.lua
23
init.lua
|
@ -13,4 +13,25 @@ end
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue