From bdf63b36517d9ce97d111c9b822f24b6c6dbac24 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 23 Feb 2024 00:28:48 +0100 Subject: [PATCH] Some nvim rust stuff --- home/neovim/init.lua | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/home/neovim/init.lua b/home/neovim/init.lua index 28076b4..dda0a4d 100644 --- a/home/neovim/init.lua +++ b/home/neovim/init.lua @@ -27,27 +27,31 @@ require('packer').startup(function(use) } use { - 'simrat39/rust-tools.nvim', + "mrcjkb/rustaceanvim", + ft = { 'rust' }, requires = { - { 'neovim/nvim-lspconfig' }, - - -- Debugging - { 'nvim-lua/plenary.nvim' }, - { 'mfussenegger/nvim-dap' }, + { + "lvimuser/lsp-inlayhints.nvim", + opts = {} + }, + { "nvim-lua/plenary.nvim" }, + { "mfussenegger/nvim-dap" }, }, config = function() - local rt = require("rust-tools") - - rt.setup({ - server = { - on_attach = function(_, bufnr) - -- Hover actions - vim.keymap.set("n", "", rt.hover_actions.hover_actions, { buffer = bufnr }) - -- Code action groups - vim.keymap.set("n", "a", rt.code_action_group.code_action_group, { buffer = bufnr }) - end, + vim.g.rustaceanvim = { + tools = { + hover_actions = { + auto_focus = true, + }, }, - }) + server = { + on_attach = function(client, bufnr) + require("lsp-inlayhints").setup() + require("lsp-inlayhints").on_attach(client, bufnr) + require("lsp-inlayhints").show() + end + } + } end, }