Some nvim rust stuff

This commit is contained in:
Valentin Brandl 2024-02-23 00:28:48 +01:00
parent 065f1ae8bf
commit bdf63b3651
Signed by: vbrandl
GPG Key ID: CAD4DA1A789125F9

View File

@ -27,27 +27,31 @@ require('packer').startup(function(use)
} }
use { use {
'simrat39/rust-tools.nvim', "mrcjkb/rustaceanvim",
ft = { 'rust' },
requires = { requires = {
{ 'neovim/nvim-lspconfig' }, {
"lvimuser/lsp-inlayhints.nvim",
-- Debugging opts = {}
{ 'nvim-lua/plenary.nvim' }, },
{ 'mfussenegger/nvim-dap' }, { "nvim-lua/plenary.nvim" },
{ "mfussenegger/nvim-dap" },
}, },
config = function() config = function()
local rt = require("rust-tools") vim.g.rustaceanvim = {
tools = {
rt.setup({ hover_actions = {
server = { auto_focus = true,
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", 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,
}, },
}) },
server = {
on_attach = function(client, bufnr)
require("lsp-inlayhints").setup()
require("lsp-inlayhints").on_attach(client, bufnr)
require("lsp-inlayhints").show()
end
}
}
end, end,
} }