add code action menu and remap to Alt+Enter
This commit is contained in:
parent
c16858ffc7
commit
9570523e75
2 changed files with 8 additions and 2 deletions
|
@ -33,7 +33,8 @@ local on_attach = function(client, bufnr)
|
|||
buf_set_keymap('n', '<leader>llw', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
buf_set_keymap('n', '<leader>lt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
buf_set_keymap('n', '<leader>lrn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
buf_set_keymap('n', '<leader>lca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
buf_set_keymap('n', '<M-CR>', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.document_formatting then
|
||||
|
@ -140,6 +141,9 @@ nvim_lsp.rust_analyzer.setup({
|
|||
procMacro = {
|
||||
enable = true
|
||||
},
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -3,6 +3,8 @@ return require('packer').startup(function()
|
|||
-- Packer can manage itself as an optional plugin
|
||||
use {'wbthomason/packer.nvim', opt = true }
|
||||
|
||||
use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' }
|
||||
|
||||
-- Fuzzy finder
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
|
|
Loading…
Reference in a new issue