diff options
| author | Tom Li Dobnik <tomlidobnik1@gmail.com> | 2026-02-23 07:44:54 +0100 |
|---|---|---|
| committer | Tom Li Dobnik <tomlidobnik1@gmail.com> | 2026-02-23 07:44:54 +0100 |
| commit | 4cf642a4e17473e71849444e2f6d6d8ce245bb96 (patch) | |
| tree | 72d04f5e6d1da6756dc5793a1d03ade90a2290dd /.config/nvim/lua/config/plugins/lsp.lua | |
| parent | 95bb1945715c94b033e5e8e4f633f791a68c6c9e (diff) | |
update
Diffstat (limited to '.config/nvim/lua/config/plugins/lsp.lua')
| -rw-r--r-- | .config/nvim/lua/config/plugins/lsp.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/.config/nvim/lua/config/plugins/lsp.lua b/.config/nvim/lua/config/plugins/lsp.lua index 4d4dcc0..eb812d2 100644 --- a/.config/nvim/lua/config/plugins/lsp.lua +++ b/.config/nvim/lua/config/plugins/lsp.lua @@ -138,7 +138,12 @@ return { [vim.diagnostic.severity.HINT] = " ", }, }, - virtual_text = { current_line = true }, + virtual_text = { + source = "if_many", + spacing = 2, + }, + update_in_insert = true, + virtual_lines = false, -- virtual_text = { -- source = "if_many", -- spacing = 2, @@ -164,6 +169,7 @@ return { -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local lspconfig_util = require("lspconfig.util") local servers = { bashls = {}, marksman = {}, @@ -184,6 +190,13 @@ return { "--fallback-style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never}", }, }, + rust_analyzer = { + single_file_support = true, + root_dir = function(fname) + return lspconfig_util.root_pattern("Cargo.toml", "rust-project.json", ".git")(fname) + or vim.fs.dirname(fname) + end, + }, lua_ls = {}, } -- Ensure the servers and tools above are installed -- @@ -208,6 +221,7 @@ return { require("mason-lspconfig").setup({ ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) automatic_installation = false, + automatic_enable = false, handlers = { function(server_name) if server_name == "rust_analyzer" then |
