mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.39k stars 411 forks source link

Emmet not expanding correctly when there is a colon on syntax #521

Open efierros opened 3 years ago

efierros commented 3 years ago

When I do: .x:scol-12

The expect behavior and the result in SublimeText and VS Code is <div class="x:scol-12"></div>

But in emmet-vim the result is: <div class="x"></div>

Is there a config fix for this?

aldimhr commented 2 years ago

working fine after I installed coc-emmet, maybe it can help your problem

https://github.com/neoclide/coc-emmet/blob/master/Readme.md

Peek 2021-10-01 20-11

efierros commented 2 years ago

Sorry but even with coc-emmet is not working, I don't know if I need some extra configuration but as I use nvim-lsp and treesitter, there might be some incompatibility issues.

Thanks anyways.

SpazJibo commented 2 years ago

I am having the same issue as well. I haven't tried installing coc-emmet yet but I would expect the base emmet to support this in vim.

SpazJibo commented 2 years ago

@aldimhr I attempted using coc-emmet too and this didn't seem to work for me either I end up getting just <div class="md"></div> when I input div.md:hidden as an example.

efierros commented 2 years ago

I tried this on a nvim fresh install and it's the same. Tried with vim plug and Packer.

aldimhr commented 2 years ago

@efierros @SpazJibo Hi, I just tried to uninstall coc-emmet, same result as you guys. In my case, coc-emmet was the solution.

Here is my vimrc https://gist.github.com/aldimhr/30a070570889a8215589fadee29baa1b

Appreciate, if there is any other information so that I can help with this issues

efierros commented 2 years ago

@aldimhr HI, thanks for your help, but even with your configuration I can't make emmet work properly.

I don't know if it might be the version, I'm using nvim v0.6.1

joswr1ght commented 1 year ago

I'm having the same issue, vim 9.0.1050. Entering .p-12.md:p-16 with coc-emmet installed produces the correct expansion preview:

Screen Shot 2023-01-05 at 6 28 47 AM

But expanding it produces this:

Screen Shot 2023-01-05 at 6 29 04 AM

The expected expansion should be <div class="p-12 md:p-16"></div>. Any advice @mattn? Thanks!

joswr1ght commented 1 year ago

It looks like this issue was fixed in PR https://github.com/mattn/emmet-vim/pull/474 by @petter in 2020, but @mattn hasn't merged it. I just changed my .vimrc to point to @petter's branch instead:

" Emmet
" Plug 'https://github.com/mattn/emmet-vim.git'
" Emmet with : expansion fix
Plug 'https://github.com/petter/emmet-vim.git'

emmet-vim mov

Thanks @petter, and thanks to @mattn for making emmet-vim OSS!