initial
This commit is contained in:
48
lua/plugins/rust.lua
Normal file
48
lua/plugins/rust.lua
Normal file
@ -0,0 +1,48 @@
|
||||
return {
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
config = function()
|
||||
vim.g.rustaceanvim = {
|
||||
-- Plugin configuration
|
||||
tools = {},
|
||||
-- LSP configuration
|
||||
server = {
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = {
|
||||
snippetSupport = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- you can also put keymaps in here
|
||||
vim.keymap.set("n", "<leader>ca", 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",
|
||||
"<leader>t", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||
function()
|
||||
vim.cmd.RustLsp({ "renderDiagnostic", "current" }) -- defaults to 'cycle'
|
||||
end,
|
||||
{ silent = true, buffer = bufnr }
|
||||
)
|
||||
end,
|
||||
default_settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- DAP configuration
|
||||
dap = {},
|
||||
}
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user