vscode-nunjucks icon indicating copy to clipboard operation
vscode-nunjucks copied to clipboard

Emmet is not working with nunjucks files

Open jitendravyas opened this issue 8 years ago • 19 comments

jitendravyas avatar Sep 30 '16 11:09 jitendravyas

No generally there are issues with intellisense issue#3

ronnidc avatar Sep 30 '16 12:09 ronnidc

I wanted to say that Emmet is working with nunjucks files

jitendravyas avatar Sep 30 '16 13:09 jitendravyas

VSC update the emmet to v2.0. U can check it in

https://code.visualstudio.com/blogs/2017/08/07/emmet-2.0#_other-changes

it works fine now

chenyuncai avatar Aug 29 '17 16:08 chenyuncai

Hi, not working for me. Have I got to install something to make it work?

afalchi82 avatar Mar 20 '18 11:03 afalchi82

it works vscode issues 1689

// settings.json
"emmet.includeLanguages": {
    "nunjucks": "html"
 }

wangguohao avatar Apr 08 '18 04:04 wangguohao

it works vscode issues 1689

// settings.json
"emmet.includeLanguages": {
    "nunjucks": "html"
 }

will this work regardless of file extension? i.e. *.njk

rbfonbuena avatar Sep 26 '18 03:09 rbfonbuena

it works vscode issues 1689

// settings.json
"emmet.includeLanguages": {
    "nunjucks": "html"
 }

will this work regardless of file extension? i.e. *.njk

It seems to me that the value html refers to the language emmet will autocomplete (HTML as opposed to CSS), not the extension of the file itself.

emmiep avatar Oct 30 '18 15:10 emmiep

it works vscode issues 1689

// settings.json
"emmet.includeLanguages": {
    "nunjucks": "html"
 }

It worked for me, thank you!

jonsoa avatar Nov 22 '18 02:11 jonsoa

// settings.json "emmet.includeLanguages": { "nunjucks": "html" }

It worked for me,thanks

ZJL-CFPL avatar May 21 '19 01:05 ZJL-CFPL

Any tips on getting this to work in Atom?

Thanks

ChristianBetts avatar May 23 '19 10:05 ChristianBetts

For me

...
"njk": "html"
...

instead

...
"nunjucks": "html"
...

MrLechu avatar Jun 03 '19 19:06 MrLechu

The above command works provided you have the correct keybinding for Emmet expand. I had to press CMD+e to expand.

Tip: open the command palette CMD+P and search for Emmet expand to see the associated keys

haikyuu avatar Jul 23 '20 16:07 haikyuu

I tried both "nunjucks": "html" and "njk": "html" and neither worked.

But in in the bottom right corner of vs code (blue menu) there is an option change 'language mode' from "plain text" to "HTML" this seemed to do the trick.

(you could also do this in the normal setting (not the actual JSON file) if you search for "emmet")

perhenrikgithub avatar Sep 09 '21 20:09 perhenrikgithub

If you are using UI just add it in the list or if you are using json https://github.com/ronnidc/vscode-nunjucks/issues/7#issuecomment-379519584 would be useful

Screenshot 2021-10-11 at 8 16 34 PM

hybridx avatar Oct 11 '21 14:10 hybridx

I tried both "nunjucks": "html" and "njk": "html" and neither worked.

But in in the bottom right corner of vs code (blue menu) there is an option change 'language mode' from "plain text" to "HTML" this seemed to do the trick.

(you could also do this in the normal setting (not the actual JSON file) if you search for "emmet")

Thanks! This worked for me!!

murtuzaalisurti avatar Feb 18 '22 05:02 murtuzaalisurti

Thank you lad! Worked like a champ!

deiondz avatar Apr 29 '22 08:04 deiondz

Adding a file association worked for me: "files.associations": { "*.njk": "html" },

wjoliver avatar May 21 '23 10:05 wjoliver

I tried both "nunjucks": "html" and "njk": "html" and neither worked.

But in in the bottom right corner of vs code (blue menu) there is an option change 'language mode' from "plain text" to "HTML" this seemed to do the trick.

(you could also do this in the normal setting (not the actual JSON file) if you search for "emmet")

THIS! lol I could not figure out what the issue was but once I switched it to HTML, the settings.json code worked. I selected "Configure file association for '.njk'" so I wouldn't have to keep changing this each time.

diamondalexander avatar Apr 03 '24 03:04 diamondalexander

Adding a file association worked for me: "files.associations": { "*.njk": "html" },

This was the only way that worked for me for some reason...

bigbass11 avatar Jul 09 '24 01:07 bigbass11