Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get HTML snippets/suggestions when in ERB mode (VSCode)

When in ERB language mode, I'd like to have all the html and emmett shortcuts/snippets available. I usually switch back and forth between HTML and ERB mode depending on what kinds of tags I need at the moment, but that's a pain, and I also like to always have the ERB code colors. IS there a simple way to do this?

like image 457
Jonathan Tuzman Avatar asked Oct 26 '25 15:10

Jonathan Tuzman


2 Answers

"emmet.includeLanguages": { "ruby": "html" } 

It doens't work

But if it changes "ruby" to "erb", works fine.

"emmet.includeLanguages": { "erb": "html" } 

In mac, type cmd + shift + p, open settings json. and add upper option or change it.

like image 139
ogelacinyc Avatar answered Oct 28 '25 04:10

ogelacinyc


I don't know anything about ERB but can you try the setting:

"emmet.includeLanguages": { "ruby": "html" } 

or something similar for the emmet functionality.

Another possibility is to associate the ERB files to html ala:

"files.associations": { "*.ERB" : "html" } 
like image 35
Mark Avatar answered Oct 28 '25 05:10

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!