mattn / emmet-vim

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

Emmet only expands the last argument #463

Closed iggredible closed 5 years ago

iggredible commented 5 years ago

When I do

html:[5]

(cursor on 5) and C-y ;, I get the usual html expansion. Works as expected

However, if I try complex abbreviation involving (., >, #, etc), it only expands on the last word. In some cases (abbreviations containing square brackets) it doesn't work at all For example:

div>ul>l[i] -> div>ul><li></li>
div+p+b[q] -> div+p+<blockquote></blockquote>
td[title="Hello world!" colspan=3] -> doesn't work at all
div#header+div.page+div#footer.class1.class2.class3 -> div#header+div.page+div#footer.class1.class2.<class3></class3> (this expands class class3 into class3 tag instead)

My dotfiles can be found here. I am using neovim v0.3.4 on MacOS Sierra 10.13.6. Using iTerm2.

I don't remember when it started behaving like this, but it used to work a few weeks ago. Any idea what happened?

mattn commented 5 years ago

html:[5]

It seems not an expression of emmet.

I tried this on https://docs.emmet.io/

iggredible commented 5 years ago

Haha, sorry for not being clear. I the [] is the cursor. I will add desc on my post. What I tried was html:5. Additionally, I can vouch that html:5 C-y ; does work and gives me:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
</head>
<body>

</body>
</html>

Just did this a second ago on vim, so I can vouch emmet is working for html:5, but it won't work on the issues mentioned above^

mattn commented 5 years ago

What filetype do you use? I could expand correctly.

terminal7

iggredible commented 5 years ago

Interesting. I used regular .html file. I wonder if one of my plugins intervened with emmet... I will try it without some plugins that I have tomorrow (midnight here :D) . I wonder if one of my plugins had updates that messed it up.

iggredible commented 5 years ago

Sorry for delay. I uninstalled all my plugins except for emmet-vim.

  1. I confirmed that emmet-vim is installed (html:5 expanded properly- that's how I know emmet is working)
  2. Still experiencing the same problem. I tried div>ul>li. It gives me div>ul><li></li> result.

I also tried to clear up my .vimrc, but it is still behaving the same way. So far, this tells me that none of my plugins / any of my vimrc setting is the cause of this behavior.

@mattn, does emmet look from different configs/ computer settings other than .vimrc?

I wonder if this relate to computer settings/ other dotfiles/ other configs outside of .vimrc...

iggredible commented 5 years ago

So this is actually not an issue. Emmet was working all along. I was using ul>li followed by <C-y>; whereas I should have been using ul>li then <C-y>,. I was using semi-colon instead of comma (facepalm). Emmet works fine. Never an issue. Thank you for trying to help me, @mattn ! I really appreciate it.