Skip to content

Commit e91c729

Browse files
authored
Update lsp.mdx #238
1 parent b70ca8c commit e91c729

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/routes/docs/config/lsp.mdx

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Then check [configs.md](https://github.com/neovim/nvim-lspconfig/blob/master/doc
1212
- **Plugin table**
1313

1414
```lua
15-
-- In order to modify the `lspconfig` configuration:
1615
{
1716
"neovim/nvim-lspconfig",
1817
config = function()
@@ -26,28 +25,12 @@ Then check [configs.md](https://github.com/neovim/nvim-lspconfig/blob/master/doc
2625
- **configs/lspconfig.lua**
2726

2827
```lua
29-
local nvlsp = require "nvchad.configs.lspconfig"
30-
local lspconfig = require "lspconfig"
31-
32-
nvlsp.defaults() -- loads nvchad's defaults
33-
34-
local servers = { "html", "cssls", "clangd" }
35-
36-
-- lsps with default config
37-
for _, lsp in ipairs(servers) do
38-
lspconfig[lsp].setup {
39-
on_attach = nvlsp.on_attach,
40-
on_init = nvlsp.on_init,
41-
capabilities = nvlsp.capabilities,
42-
}
43-
end
44-
45-
-- Without the loop, you would have to manually set up each LSP
46-
--
47-
-- lspconfig.html.setup {
48-
-- on_attach = nvlsp.on_attach,
49-
-- capabilities = nvlsp.capabilities,
50-
-- }
28+
require("nvchad.configs.lspconfig").defaults()
29+
30+
local servers = { "html", "cssls" }
31+
vim.lsp.enable(servers)
32+
33+
-- to configure lsps further read :h vim.lsp.config
5134
```
5235
## Mason.nvim
5336

0 commit comments

Comments
 (0)