Emmet support based on LSP.
Started as coc-emmet replacement for completion-nvim. Should work with any lsp client but not tested.
npm install -g emmet-ls
With nvim-lspconfig:
local lspconfig = require('lspconfig')
local configs = require('lspconfig/configs')
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
lspconfig.emmet_ls.setup({
-- on_attach = on_attach,
capabilities = capabilities,
filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
init_options = {
html = {
options = {
-- For possible options, see: https://github.com/emmetio/emmet/blob/master/src/config.ts#L79-L267
["bem.enabled"] = true,
},
},
}
})
html
,pug
,typescriptreact
,javascript
,javascriptreact
,svelte
,vue
,css
,sass
,scss
andless
filetypes are fully supported.- Any other filetype is treated as
html
.