mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
30 lines
653 B
Lua
30 lines
653 B
Lua
local bufnr = vim.api.nvim_get_current_buf()
|
|
vim.keymap.set(
|
|
"n",
|
|
"<leader>a",
|
|
function()
|
|
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
|
|
-- or vim.lsp.buf.codeAction() if you don't want grouping.
|
|
end,
|
|
{ silent = true, buffer = bufnr }
|
|
)
|
|
vim.keymap.set(
|
|
"n",
|
|
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
|
function()
|
|
vim.cmd.RustLsp({'hover', 'actions'})
|
|
end,
|
|
{ silent = true, buffer = bufnr }
|
|
)
|
|
|
|
vim.g.rustaceanvim = {
|
|
server = {
|
|
settings = {
|
|
["rust-analyzer"] = {
|
|
checkOnSave = {
|
|
command = "clippy",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|