mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 13:30:41 +00:00
Add LSP code action mappings
Tested with rust-analyzer
This commit is contained in:
parent
fba26a3a40
commit
bce7e624e2
1 changed files with 2 additions and 0 deletions
|
@ -31,6 +31,8 @@ local function on_attach(client, bufnr)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, "n", '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, "v", '<space>ca', '<cmd>lua vim.lsp.buf.range_code_action()<CR>', opts)
|
||||||
|
|
||||||
-- Set some keybinds conditional on server capabilities
|
-- Set some keybinds conditional on server capabilities
|
||||||
if client.resolved_capabilities.document_formatting then
|
if client.resolved_capabilities.document_formatting then
|
||||||
|
|
Loading…
Reference in a new issue