From 9570523e75339a34d9f6f3037b0bd84fcaa784cc Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Thu, 27 Jul 2023 17:40:14 +0200 Subject: [PATCH] add code action menu and remap to Alt+Enter --- lua/lang.lua | 6 +++++- lua/plugins.lua | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lang.lua b/lua/lang.lua index d538d7c..1a1c862 100644 --- a/lua/lang.lua +++ b/lua/lang.lua @@ -33,7 +33,8 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', 'llw', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) buf_set_keymap('n', 'lt', 'lua vim.lsp.buf.type_definition()', opts) buf_set_keymap('n', 'lrn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'lca', 'lua vim.lsp.buf.code_action()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.code_action()', 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", + }, } } }) diff --git a/lua/plugins.lua b/lua/plugins.lua index c0035ea..832c644 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,7 +1,9 @@ return require('packer').startup(function() -- Packer can manage itself as an optional plugin - use {'wbthomason/packer.nvim', opt = true} + use {'wbthomason/packer.nvim', opt = true } + + use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' } -- Fuzzy finder use {