diff options
| author | anand <anand.panchdhari@gmail.com> | 2025-12-17 15:57:55 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2025-12-17 15:57:55 +0530 |
| commit | b7ef29a8886a57aadb787807a7c6cf74c1f0ed3a (patch) | |
| tree | 366a68240fbc9da6b1d567bd6c46d1350ad814de /nvim/lsp/html.lua | |
Nixos
Diffstat (limited to 'nvim/lsp/html.lua')
| -rwxr-xr-x | nvim/lsp/html.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nvim/lsp/html.lua b/nvim/lsp/html.lua new file mode 100755 index 0000000..523b8b4 --- /dev/null +++ b/nvim/lsp/html.lua @@ -0,0 +1,34 @@ +---@brief +--- +--- https://github.com/hrsh7th/vscode-langservers-extracted +--- +--- `vscode-html-language-server` can be installed via `npm`: +--- ```sh +--- npm i -g vscode-langservers-extracted +--- ``` +--- +--- Neovim does not currently include built-in snippets. `vscode-html-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. +--- +--- The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. +--- +--- ```lua +--- --Enable (broadcasting) snippet capability for completion +--- local capabilities = vim.lsp.protocol.make_client_capabilities() +--- capabilities.textDocument.completion.completionItem.snippetSupport = true +--- +--- vim.lsp.config('html', { +--- capabilities = capabilities, +--- }) +--- ``` +return { + cmd = { 'vscode-html-language-server', '--stdio' }, + filetypes = { 'html', 'templ' }, + root_markers = { 'package.json', '.git' }, + settings = {}, + init_options = { + provideFormatter = true, + embeddedLanguages = { css = true, javascript = true }, + configurationSection = { 'html', 'css', 'javascript' }, + }, +} |
