From 7014dac58b65e0becb304cb7c220ee04ac1ab4c2 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 4 Aug 2024 00:57:35 +0300 Subject: feat(nvim): configured clangd lsp (and minor tweaks to luals) --- .../nvim/lua/custom/config/language-servers.lua | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/custom/config/language-servers.lua b/.config/nvim/lua/custom/config/language-servers.lua index 763a712..a88258d 100644 --- a/.config/nvim/lua/custom/config/language-servers.lua +++ b/.config/nvim/lua/custom/config/language-servers.lua @@ -1,11 +1,10 @@ --- NOTE: A list of language servers (and potentially their config) --- Accepts either true to enable, false to disable or a table with settings +-- NOTE: a table or true to enable, false to disable return { lua_ls = { settings = { - diagnostics = { - globals = { 'vim' }, - }, + diagnostics = { globals = { 'vim' } }, + telemetry = { enabled = false }, + hint = { enable = true }, workspace = { library = { [vim.fn.expand('$VIMRUNTIME/lua')] = true, @@ -14,10 +13,17 @@ return { }, }, }, -- lua - clangd = true, -- C/C++ - gradle_ls = true, -- java package manager - -- jdtls = true, -- java eclipse lsp - kotlin_language_server = true, -- kotlin + clangd = { + cmd = { 'clangd', '--clang-tidy' }, + root_dir = function(fname) + return require('lspconfig/util').root_pattern( + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + '.git' + )(fname) or vim.fn.getcwd() + end, + }, -- c/cpp pyright = { settings = { python = { @@ -25,17 +31,12 @@ return { }, }, }, -- python - rust_analyzer = false, -- NOTE: using rustaceanvim bashls = true, -- bash taplo = true, -- toml lemminx = true, -- xml yamlls = true, -- yaml jsonls = true, -- json - - -- For CS50x, sorry for everyone who sees this - -- FIX: this should be removed ASAP - html = true, - cssls = true, - eslint = true, - tsserver = true, + html = true, -- html + cssls = true, -- css + tsserver = true, -- javascript/typescript } -- cgit v1.3.1