Setup lsp server

Before starting, it is strongly recommended that you walk through the LSP configuration: lspconfig repository.

Then check to make sure your language's LSP server is present there.

  • custom/plugins.lua
-- In order to modify the `lspconfig` configuration:
   config = function()
      require "plugins.configs.lspconfig"
      require "custom.configs.lspconfig"

  • custom/configs/lspconfig.lua
local configs = require("plugins.configs.lspconfig")
local on_attach = configs.on_attach
local capabilities = configs.capabilities

local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "clangd"}

for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    on_attach = on_attach,
    capabilities = capabilities,

-- Without the loop, you would have to manually set up each LSP 
-- lspconfig.html.setup {
--   on_attach = on_attach,
--   capabilities = capabilities,
-- }
-- lspconfig.cssls.setup {
--   on_attach = on_attach,
--   capabilities = capabilities,
-- }


The mason.nvim plugin is used to install LSP servers, formatters, linters, and debug adapters. It's better to list all your required packages in your Mason override config, so they automatically install when running MasonInstallAll command.

You can find the exact name of the LSP packages using :Mason, that will open a window.

   opts = {
      ensure_installed = {

Once the binaries are installed, you will have to configure them to properly work with LSP, null-ls, nvim-dap etc. It depends on what you installed. NvChad does not provide any language configuration aside from lua.