chg: Switched to rustaceanvim for Rust

This commit is contained in:
Sayantan Santra 2024-04-01 02:32:27 -05:00
parent d89548599e
commit 1371124454
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
3 changed files with 34 additions and 24 deletions

View File

@ -52,7 +52,11 @@ require("lazy").setup(
-- vim-moonfly theme
{ "bluz71/vim-moonfly-colors", as = "moonfly" },
-- Rust tools
"simrat39/rust-tools.nvim",
{
"mrcjkb/rustaceanvim",
version = "^4",
ft = { "rust" },
},
-- Automatically add bracket pairs
"windwp/nvim-autopairs",
-- Syntax highlighting for Fish scripts

View File

@ -8,14 +8,3 @@ lspconfig.lua_ls.setup({
},
}
})
lspconfig.rust_analyzer.setup {
-- Server-specific settings. See `:help lspconfig-setup`
settings = {
['rust-analyzer'] = {
check = {
command = "clippy",
}
},
},
}

View File

@ -1,12 +1,29 @@
require("rust-tools").setup({
vim.g.rustaceanvim = {
-- Plugin configuration
tools = {
},
-- LSP configuration
server = {
settings = {
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"] = {
check = {
command = "clippy"
}
},
},
},
-- DAP configuration
dap = {
},
})
}