small changes to default mappings
This commit is contained in:
parent
e3b768619c
commit
b62bd9efa0
1 changed files with 4 additions and 8 deletions
12
init.lua
12
init.lua
|
@ -304,8 +304,9 @@ local on_attach = function(_, bufnr)
|
||||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||||
|
|
||||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||||
nmap('gi', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
|
||||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||||
|
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||||
|
|
||||||
|
@ -315,7 +316,6 @@ local on_attach = function(_, bufnr)
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
-- Lesser used LSP functionality
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
|
||||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||||
nmap('<leader>wl', function()
|
nmap('<leader>wl', function()
|
||||||
|
@ -324,11 +324,7 @@ local on_attach = function(_, bufnr)
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
if vim.lsp.buf.format then
|
vim.lsp.buf.format()
|
||||||
vim.lsp.buf.format()
|
|
||||||
elseif vim.lsp.buf.formatting then
|
|
||||||
vim.lsp.buf.formatting()
|
|
||||||
end
|
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -355,7 +351,7 @@ for _, lsp in ipairs(servers) do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Turn on status information
|
-- Turn on lsp status information
|
||||||
require('fidget').setup()
|
require('fidget').setup()
|
||||||
|
|
||||||
-- Example custom configuration for lua
|
-- Example custom configuration for lua
|
||||||
|
|
Loading…
Reference in a new issue