-- load defaults i.e lua_lsp require("nvchad.configs.lspconfig").defaults() local lspconfig = require "lspconfig" -- EXAMPLE local servers = { "html", "cssls" } local nvlsp = require "nvchad.configs.lspconfig" local spell_words = {} -- lsps with default config for _, lsp in ipairs(servers) do lspconfig[lsp].setup { on_attach = nvlsp.on_attach, on_init = nvlsp.on_init, capabilities = nvlsp.capabilities, } end lspconfig.ltex.setup({ settings = { ltex = { language = "en-US", enabled = true, dictionary = { ["en-US"] = spell_words, }, }, }, }) lspconfig.eslint.setup({ on_attach = function(client, bufnr) vim.api.nvim_create_autocmd("BufWritePre", { buffer = bufnr, command = "EslintFixAll", }) end, }) lspconfig.rust_analyzer.setup { -- server-specific settings. See ':help lspconfig-setup' settings = { ['rust_analyzer'] = {}, }, } lspconfig.basedpyright.setup { cmd = { "basedpyright-langserver", "--stdio" }, filetypes = { "python" }, settings = { basedpright = { analysis = { autoSearchPaths = true, diagnosticMode = "openFilesOnly", uuseLibraryCodeForTypes = true }, }, }, } -- configuring single server, example: typescript -- lspconfig.tsserver.setup { -- on_attach = nvlsp.on_attach, -- on_init = nvlsp.on_init, -- capabilities = nvlsp.capabilities, -- }