From df5ac4476952ea4a62878d7cbc5dea3e2c5a6c45 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 1 Apr 2024 16:49:40 -0500 Subject: [PATCH] chg: Use global codeaction keymap --- laptop/config/keymaps.lua | 3 ++- laptop/plugin/rust.lua | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/laptop/config/keymaps.lua b/laptop/config/keymaps.lua index 529a3be..93cc011 100644 --- a/laptop/config/keymaps.lua +++ b/laptop/config/keymaps.lua @@ -8,9 +8,10 @@ local opt = vim.opt g.mapleader = ',' g.maplocalleader = ';' --- Set K to hover +-- Set K to hover and ,a to show code actions api.nvim_buf_create_user_command(0, "LspHover", "lua vim.lsp.buf.hover()", { nargs = '+' }) opt.keywordprg = ":LspHover" +map('n', 'a', vim.lsp.buf.code_action, { remap = false }) -- Use ctrl-[hjkl] to select the active split! map('n', '', ":wincmd k", { silent = true }) diff --git a/laptop/plugin/rust.lua b/laptop/plugin/rust.lua index 146a6cd..fdda26f 100644 --- a/laptop/plugin/rust.lua +++ b/laptop/plugin/rust.lua @@ -4,16 +4,6 @@ vim.g.rustaceanvim = { }, -- LSP configuration server = { - on_attach = function(_, bufnr) - vim.keymap.set( - "n", - "a", - function() - vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping - end, - { silent = true, buffer = bufnr, noremap = true } - ) - end, default_settings = { -- rust-analyzer language server configuration ["rust-analyzer"] = {