chg: Use global codeaction keymap

This commit is contained in:
Sayantan Santra 2024-04-01 16:49:40 -05:00
parent 1371124454
commit df5ac44769
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
2 changed files with 2 additions and 11 deletions

View file

@ -8,9 +8,10 @@ local opt = vim.opt
g.mapleader = ',' g.mapleader = ','
g.maplocalleader = ';' 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 = '+' }) api.nvim_buf_create_user_command(0, "LspHover", "lua vim.lsp.buf.hover()", { nargs = '+' })
opt.keywordprg = ":LspHover" opt.keywordprg = ":LspHover"
map('n', '<leader>a', vim.lsp.buf.code_action, { remap = false })
-- Use ctrl-[hjkl] to select the active split! -- Use ctrl-[hjkl] to select the active split!
map('n', '<c-k>', ":wincmd k<cr>", { silent = true }) map('n', '<c-k>', ":wincmd k<cr>", { silent = true })

View file

@ -4,16 +4,6 @@ vim.g.rustaceanvim = {
}, },
-- LSP configuration -- LSP configuration
server = { server = {
on_attach = function(_, bufnr)
vim.keymap.set(
"n",
"<localleader>a",
function()
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
end,
{ silent = true, buffer = bufnr, noremap = true }
)
end,
default_settings = { default_settings = {
-- rust-analyzer language server configuration -- rust-analyzer language server configuration
["rust-analyzer"] = { ["rust-analyzer"] = {