diff --git a/nvim/lua/nvim-cmp.lua b/nvim/lua/nvim-cmp.lua index e9973bf..ba6039e 100644 --- a/nvim/lua/nvim-cmp.lua +++ b/nvim/lua/nvim-cmp.lua @@ -45,38 +45,11 @@ cmp.setup.cmdline(':', { matching = { disallow_symbol_nonprefix_matching = false } }) - --- Set up lspconfig. -local capabilities = require('cmp_nvim_lsp').default_capabilities() -local lsp = require('lspconfig') - --- lsp.ccls.setup{ --- capabilities = capabilities, --- init_options = { --- cache = { --- directory = vim.fn.expand("~/.cache/ccls") -- Store index globally --- }, --- compilationDatabaseDirectory = "build", -- Uses 'build/compile_commands.json' if present --- highlight = { lsRanges = true }, -- Improves semantic highlighting --- index = { --- threads = 4, -- Adjust based on your CPU (more threads = faster indexing) --- initialBlacklist = { ".*_test.cpp", ".*_unittest.cpp" } --- -- initialBlacklist = { ".*_test.cpp", ".*_unittest.cpp", "/home/furtest/linux_bidouille/.*" } -- Avoid indexing test files --- }, --- completion = { --- detailedLabel = true -- Better completion info --- }, --- diagnostics = { --- onChange = 300 -- Delay diagnostics updates for better performance --- } --- } --- } - - --- clangd and ccls are both C and C++ language servers --- having them both active at the same time is useless -lsp.clangd.setup { - capabilities = capabilities, - cmd = { "clangd", "--enable-config" }, +vim.lsp.config.clangd = { + cmd = { 'clangd', '--background-index' }, + root_markers = { 'compile_commands.json', 'compile_flags.txt', '.clangd' }, + filetypes = { 'c', 'cpp' }, } +vim.lsp.enable({'clangd'}) +