From dd8de0ecd58263649290cd11e74dbbb7950a4e44 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 7 Dec 2022 12:06:58 +0300 Subject: feat(nvim): use rust-tools and fidget new plugins make us go microsoft code --- .config/nvim/lua/plugin_settings.lua | 51 +++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/plugin_settings.lua') diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index fbd54ad..7ca473f 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua @@ -363,7 +363,7 @@ end -- bring in cmp_nvim_lsp local capabilities = require('cmp_nvim_lsp').default_capabilities() -local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd', 'ltex' } +local servers = { 'jedi_language_server', 'texlab', 'clangd', 'ltex' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, @@ -377,6 +377,44 @@ nvim_lsp['efm'].setup{ capabilities = capabilities } +-- Configure LSP through rust-tools.nvim plugin. +-- rust-tools will configure and enable certain LSP features for us. +-- See https://github.com/simrat39/rust-tools.nvim#configuration +local rust_opts = { + tools = { + runnables = { + use_telescope = true, + }, + inlay_hints = { + auto = true, + show_parameter_hints = false, + 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 + server = { + -- on_attach is a callback called when the language server attachs to the buffer + 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", + }, + }, + }, + }, +} + +require('rust-tools').setup(rust_opts) + + -- }}} nvim-lsp -- -- vista {{{ -- @@ -587,3 +625,14 @@ require('leap').setup { } -- }}} leap.nvim -- + +-- fidget.nvim {{{ -- +require("fidget").setup{ +-- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md + text = { + spinner = "triangle" + } + +} +-- }}} fidget.nvim -- + -- cgit v1.2.3-70-g09d2