My nvim configuration
| 1 | ---@brief |
| 2 | --- |
| 3 | --- https://github.com/hrsh7th/vscode-langservers-extracted |
| 4 | --- |
| 5 | --- `css-languageserver` can be installed via `npm`: |
| 6 | --- |
| 7 | --- ```sh |
| 8 | --- npm i -g vscode-langservers-extracted |
| 9 | --- ``` |
| 10 | --- |
| 11 | --- Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. |
| 12 | --- |
| 13 | --- ```lua |
| 14 | --- --Enable (broadcasting) snippet capability for completion |
| 15 | --- local capabilities = vim.lsp.protocol.make_client_capabilities() |
| 16 | --- capabilities.textDocument.completion.completionItem.snippetSupport = true |
| 17 | --- |
| 18 | --- vim.lsp.config('cssls', { |
| 19 | --- capabilities = capabilities, |
| 20 | --- }) |
| 21 | --- ``` |
| 22 | |
| 23 | ---@type vim.lsp.Config |
| 24 | return { |
| 25 | cmd = { 'vscode-css-language-server', '--stdio' }, |
| 26 | filetypes = { 'css', 'scss', 'less' }, |
| 27 | init_options = { provideFormatter = true }, -- needed to enable formatting capabilities |
| 28 | root_markers = { 'package.json', '.git' }, |
| 29 | settings = { |
| 30 | css = { validate = true }, |
| 31 | scss = { validate = true }, |
| 32 | less = { validate = true }, |
| 33 | }, |
| 34 | } |