emmet-vim icon indicating copy to clipboard operation
emmet-vim copied to clipboard

Emmet in Django templater

Open delminskii opened this issue 9 years ago • 14 comments

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?

delminskii avatar Oct 24 '15 07:10 delminskii

please explain what you expected?

mattn avatar Oct 25 '15 12:10 mattn

@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

delminskii avatar Oct 25 '15 12:10 delminskii

what is filetype of the file?

mattn avatar Oct 25 '15 12:10 mattn

@mattn The filetype is html

delminskii avatar Oct 25 '15 13:10 delminskii

I still not understand what is your issue.

On 10/25/15, Nikolay [email protected] 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

  • Yasuhiro Matsumoto

mattn avatar Oct 25 '15 13:10 mattn

@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.

delminskii avatar Oct 25 '15 14:10 delminskii

Could you please try latest commit?

mattn avatar Oct 26 '15 00:10 mattn

@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.

delminskii avatar Oct 26 '15 13:10 delminskii

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

mattn avatar Oct 26 '15 16:10 mattn

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

dan-gamble avatar Nov 17 '15 11:11 dan-gamble

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

delminskii avatar Nov 17 '15 11:11 delminskii

@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

dan-gamble avatar Nov 17 '15 11:11 dan-gamble

@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.

delminskii avatar Nov 17 '15 11:11 delminskii

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

Thank you

LaxmanMaharjan avatar May 20 '21 15:05 LaxmanMaharjan