feat: map lsp commands

This commit is contained in:
Michael Mandl 2022-02-22 08:45:30 +01:00
parent 9ce3404d79
commit ec4a2c0af9
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7

View file

@ -60,6 +60,14 @@ local function custom_on_attach(client, buffer_nr)
-- Inspect function
bufnnoremap("K", "<Cmd>lua vim.lsp.buf.hover()<CR>")
bufnnoremap("<C-k>", "<Cmd>lua vim.lsp.buf.signature_help()<CR>")
-- Navigation
bufnnoremap("gd", "<Cmd>lua vim.lsp.buf.definition()<CR>")
bufnnoremap("gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>")
bufnnoremap("gi", "<Cmd>lua vim.lsp.buf.implementation()<CR>")
bufnnoremap("gr", "<Cmd>lua vim.lsp.buf.references()<CR>")
bufnnoremap("ga", "<Cmd>lua vim.lsp.buf.code_action()<CR>")
-- Rename all references of symbol
bufnnoremap("<leader>R", "<Cmd>lua vim.lsp.buf.rename()<CR>")