nvim-lspinstall icon indicating copy to clipboard operation
nvim-lspinstall copied to clipboard

Consider emmet-ls

Open ChristianChiarulli opened this issue 4 years ago • 9 comments

Should be easy since it can be install with npm

https://github.com/aca/emmet-ls

ChristianChiarulli avatar Apr 15 '21 03:04 ChristianChiarulli

Awesome, I was looking for emmet completions myself :) Will add this soon

kabouzeid avatar Apr 15 '21 08:04 kabouzeid

@ChristianChiarulli have you tried it? Not sure I want to bundle this, as the emmet-ls lang server doesn't work too well for me.

  1. completion often needs to be triggered manually (eg not automatically on type)
  2. cursor position after completion is <p></p>| instead of <p>|</p>

kabouzeid avatar Apr 15 '21 10:04 kabouzeid

Will probably add this when the npm release is updated. There are some promising commits in the repo that are not yet published.

kabouzeid avatar Apr 16 '21 16:04 kabouzeid

If you want this for yourself, just add it to your config somewhere before setup():

require'lspinstall/servers'.emmet = {
  install_script = [[
  ! test -f package.json && npm init -y --scope=lspinstall || true
  npm install emmet-ls
  ]],
  default_config = {
    cmd = { "./node_modules/.bin/emmet-ls", "--stdio" },
    filetypes = { 'html', 'css' },
    root_dir = require'lspconfig'.util.root_pattern(".git", vim.fn.getcwd()),
  }
}

Then you'll be able to :LspInstall emmet

kabouzeid avatar Apr 16 '21 16:04 kabouzeid

@ChristianChiarulli have you tried it? Not sure I want to bundle this, as the emmet-ls lang server doesn't work too well for me.

1. completion often needs to be triggered manually (eg not automatically on type)

2. cursor position after completion is `<p></p>|` instead of `<p>|</p>`

@kabouzeid This is how emmet-ls works for me. I had to use completion-nvim to make it work like this.
My configs are here

However, I'm switching over to use @ChristianChiarulli 's lunarvim project as a base for my new configuration.

emmet-experience

rebuilt avatar Apr 30 '21 12:04 rebuilt

Will probably add this when the npm release is updated. There are some promising commits in the repo that are not yet published.

Hey, just to let you know, the npm package finally got updated a couple of days ago, it's working better for me, although the integration with nvim-compe is not as good yet, there's some snippets that don't expand correctly with compe :(

rafamadriz avatar May 26 '21 12:05 rafamadriz

@rafamadriz which snippets for example?

kabouzeid avatar Jun 20 '21 12:06 kabouzeid

@kabouzeid Okay it seems like it's all working fine now, for the longest time any snippet that had $ or spaces a{Item $} wouldn't work at all using nvim-compe. Just tried once again and those snippets get properly expanded now.

rafamadriz avatar Jun 20 '21 13:06 rafamadriz

Thanks for the fast response! Sounds great, I'll give it another try, and bundle the installer in nvim-lspinstall if it's working as expected.

kabouzeid avatar Jun 20 '21 13:06 kabouzeid