mattn / emmet-vim

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

Emmet in Django templater #302

Open delminskii opened 8 years ago

delminskii commented 8 years ago

Hello, I have a question. Does this plugin work in django template? It works OK in raw html file, but not in default django template language (*.html also). Can I fix it manually?

mattn commented 8 years ago

please explain what you expected?

delminskii commented 8 years ago

@mattn It's hard to write raw html for me, so I've chosen this plugin to achieve that goal, but it doesn't work in django template which contains some blocks (look at the attachment, please). 12

mattn commented 8 years ago

what is filetype of the file?

delminskii commented 8 years ago

@mattn The filetype is html

mattn commented 8 years ago

I still not understand what is your issue.

On 10/25/15, Nikolay notifications@github.com wrote:

@mattn The filetype is html


Reply to this email directly or view it on GitHub: https://github.com/mattn/emmet-vim/issues/302#issuecomment-150920851

delminskii commented 8 years ago

@mattn emmet-vim doesn't work in django template (html). For example, I have: {% content %} then I append: .hello>#world then I try toggling this plugin by hotkey ([tab], for me) and nothing happens, but I expect: `

and result should be: {% content %}
`

But there's only the next: {% content %} .hello>#world[tab],, i.e. this plugin hasn't power here.

mattn commented 8 years ago

Could you please try latest commit?

delminskii commented 8 years ago

@mattn I've updated all plugins from my .vimrc by Vundle plugin-manager, and there's still a problem. I may give you an example template file (look at this, please: http://pastebin.com/3ZLZtebZ) ... (copy-paste into test.html on your local machine, then reopen this file and then block, if, endif ... etc django-template tokens must be highlighted by vim, as you may see on the piece of my vim-screen above) and maybe you should play around with emmet there to reproduce problem.

mattn commented 8 years ago

where is your cursor? please show me BEFORE and AFTER you expected.

dan-gamble commented 8 years ago

The filetype is normally htmldjango not html. Have you tried adding that to autocmd FileType html,htmldjango,css,scss EmmetInstall?

delminskii commented 8 years ago

@DanGamble89 I haven't tried that, sorry. Your solution works great! Thanks. I haven't known about that. This topic may be closed now.

dan-gamble commented 8 years ago

@delminskii Happy to help :) I had the same problem this morning but if you run :set filetype? it will tell you what the filetype of the file is

delminskii commented 8 years ago

@DanGamble89 Okay, I bear it in the mind for the future. I tried django only in autocmd FileType, but this didn't help. So now problem is solved.

LaxmanMaharjan commented 3 years ago

The filetype is normally htmldjango not html. Have you tried adding that to autocmd FileType html,htmldjango,css,scss EmmetInstall?

Thank you