From b120a8062adb233b0f48cafc31c5ef69d97e47ec Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 3 Sep 2022 15:39:51 +0200 Subject: [PATCH] Update dot_config/nvim/lua/plugins/nvim-rust-tools.lua --- dot_config/nvim/lua/plugins/nvim-rust-tools.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dot_config/nvim/lua/plugins/nvim-rust-tools.lua b/dot_config/nvim/lua/plugins/nvim-rust-tools.lua index 76519e4..401b25a 100644 --- a/dot_config/nvim/lua/plugins/nvim-rust-tools.lua +++ b/dot_config/nvim/lua/plugins/nvim-rust-tools.lua @@ -3,10 +3,6 @@ local opts = { -- Automatically set inlay hints (type hints) autoSetHints = true, - -- Whether to show hover actions inside the hover window - -- This overrides the default hover handler - hover_with_actions = true, - -- how to execute terminal commands -- options right now: termopen / quickfix executor = require("rust-tools/executors").termopen, @@ -98,7 +94,15 @@ local opts = { -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer - server = {}, -- rust-analyer options + -- rust-analyer options + 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, + }, -- debugging stuff dap = { @@ -116,4 +120,4 @@ end return { init = init -} \ No newline at end of file +}