From 6fcb0c16a7f8f5e723f7a739014e45da4a104156 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Mon, 2 Sep 2024 10:33:23 +0200 Subject: nvim: migrate to rustaceanvim --- .config/nvim/after/ftplugin/rust.vim | 3 --- .config/nvim/lua/plugins/lsp.lua | 40 ++++++++++++------------------------ 2 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 .config/nvim/after/ftplugin/rust.vim diff --git a/.config/nvim/after/ftplugin/rust.vim b/.config/nvim/after/ftplugin/rust.vim deleted file mode 100644 index fb601d1..0000000 --- a/.config/nvim/after/ftplugin/rust.vim +++ /dev/null @@ -1,3 +0,0 @@ -setlocal tags=./rusty-tags.vi;/ - -autocmd BufWritePost *.rs :silent! exec "!rusty-tags vi --quiet --start-dir=" . expand('%:p:h') . "&" | redraw! diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index e80223a..e9e8be8 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -149,39 +149,24 @@ return { } }) - -- rust-tools - local rust_opts = { + vim.g.rustaceanvim = { + -- Plugin configuration tools = { - runnables = { - use_telescope = true, - }, - inlay_hints = { - auto = true, - show_parameter_hints = true, - parameter_hints_prefix = "↸ ", - other_hints_prefix = "❱ ", - }, }, - - -- 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/CONFIG.md#rust_analyzer + -- LSP configuration server = { on_attach = on_attach, - settings = { - -- to enable rust-analyzer settings visit: - -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc - ["rust-analyzer"] = { - -- enable clippy on save - checkOnSave = { - command = "clippy", - }, + vim.lsp.inlay_hint.enable(true), + default_settings = { + -- rust-analyzer language server configuration + ['rust-analyzer'] = { }, }, }, + -- DAP configuration + dap = { + }, } - - require('rust-tools').setup(rust_opts) end, }, { @@ -206,8 +191,9 @@ return { }, }, { - "simrat39/rust-tools.nvim", - event = "LspAttach", + 'mrcjkb/rustaceanvim', + version = '^5', -- Recommended + lazy = false, -- This plugin is already lazy }, { "folke/lazydev.nvim", -- cgit v1.2.3-70-g09d2