From 5abe595986a6b66a549e09b55ecfb5fb182c5d8c Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 8 Apr 2022 08:03:34 +0200 Subject: [PATCH] feat: add rust-tools plugin --- nvim/lua/plugins.lua | 3 +++ nvim/lua/plugins/lspconfig.lua | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index a5b1874..2281a5b 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -193,6 +193,9 @@ return require('packer').startup(function(use) -- automatic pairs use({"Raimondi/delimitMate"}) + -- rust tools + use({"simrat39/rust-tools.nvim", requires = {{"neovim/nvim-lspconfig"}}}) + -- markdown preview use({'iamcco/markdown-preview.nvim'}) diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index 1e1f401..6ee2338 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -142,5 +142,13 @@ lsp_installer.on_server_ready(function(server) extra_server_opts[server.name](opts) end - server:setup(opts) + if server.name == "rust_analyzer" then + require("rust-tools").setup({ + server = vim.tbl_deep_extend("force", server:get_default_options(), + opts) + }) + server:attach_buffers() + else + server:setup(opts) + end end)