chg: Use global codeaction keymap
This commit is contained in:
parent
1371124454
commit
df5ac44769
2 changed files with 2 additions and 11 deletions
|
@ -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', '<leader>a', vim.lsp.buf.code_action, { remap = false })
|
||||
|
||||
-- Use ctrl-[hjkl] to select the active split!
|
||||
map('n', '<c-k>', ":wincmd k<cr>", { silent = true })
|
||||
|
|
|
@ -4,16 +4,6 @@ vim.g.rustaceanvim = {
|
|||
},
|
||||
-- LSP configuration
|
||||
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 = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
|
|
Loading…
Reference in a new issue