mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
34 lines
658 B
Lua
34 lines
658 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",
|
|
function()
|
|
if vim.bo.filetype == "rust" then
|
|
vim.cmd.RustLsp({'hover', 'actions'})
|
|
else
|
|
vim.lsp.buf.hover()
|
|
end
|
|
end,
|
|
{ silent = true, buffer = bufnr }
|
|
)
|
|
|
|
vim.g.rustaceanvim = {
|
|
server = {
|
|
settings = {
|
|
["rust-analyzer"] = {
|
|
checkOnSave = {
|
|
command = "clippy",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|