require("nvchad.configs.lspconfig").defaults() local lsp_dir = vim.fn.stdpath("data") .. "/lazy/nvim-lspconfig/lsp" local ok, files = pcall(vim.fn.readdir, lsp_dir) if not ok then return end for _, file in ipairs(files) do local name = file:match("^(.+)%.lua$") if name then local cfg_ok, cfg = pcall(dofile, lsp_dir .. "/" .. file) if cfg_ok and type(cfg) == "table" and type(cfg.cmd) == "table" then local cmd = cfg.cmd[1] if type(cmd) == "string" and vim.fn.executable(cmd) == 1 then vim.lsp.config(name, cfg) vim.lsp.enable(name) end end end end