Move from rust-tools(deprecated) to rustaceanvim

This commit is contained in:
Yann 2024-04-15 08:22:40 +02:00
parent e68adac7e8
commit 38be6a0f12

View File

@ -1,3 +1,4 @@
local bufnr = vim.api.nvim_get_current_buf()
-- Packer {{{ -- Packer {{{
-- Install packer -- Install packer
local ensure_packer = function() local ensure_packer = function()
@ -104,13 +105,7 @@ require('packer').startup(function(use)
-- } -- }
-- development -- development
use { use {"mrcjkb/rustaceanvim", tag = "4.*"}
"simrat39/rust-tools.nvim",
requires = {
{'nvim-lua/plenary.nvim'}, -- LUA framework
{'mfussenegger/nvim-dap'},-- Debug Adapter Protocol
}
}
use {'folke/neodev.nvim', -- Additional lua configuration, makes nvim stuff amazing use {'folke/neodev.nvim', -- Additional lua configuration, makes nvim stuff amazing
config = function() require('neodev').setup() end config = function() require('neodev').setup() end
} }
@ -251,6 +246,7 @@ map('n', '<tab>', ':lua require("harpoon.ui").nav_next()<CR>', {noremap = true})
map('i', '<C-space>', 'copilot#Accept("<CR>")', {noremap = true, silent = true, expr = true}) map('i', '<C-space>', 'copilot#Accept("<CR>")', {noremap = true, silent = true, expr = true})
-- vim.g.copilot_no_tab_map = true -- vim.g.copilot_no_tab_map = true
-- vim.g.copilot_assume_mapped = true -- https://www.reddit.com/r/neovim/comments/sk70rk/using_github_copilot_in_neovim_tab_map_has_been/ -- vim.g.copilot_assume_mapped = true -- https://www.reddit.com/r/neovim/comments/sk70rk/using_github_copilot_in_neovim_tab_map_has_been/
map('n', '<leader>ra', "<cmd>lua vim.cmd.RustLsp('codeAction')<CR>",{ silent = true})
-- }}} -- }}}
-- Lsp {{{ -- Lsp {{{
@ -514,17 +510,6 @@ luasnip.add_snippets("markdown", {
-- }}} -- }}}
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<Leader>rh", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})
require("noice").setup({ require("noice").setup({
lsp = { lsp = {