简体   繁体   中英

VSCODE - How to auto closing html code of ruby on rails html.erb file

I want to auto closing the html code in the html.erb file.
What should I do?


Added screenshots


在此输入图像描述

  1. Install the Ruby extension.
  2. Add this to your user settings:

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

Example with erb and ruby:

VSCode用户设置

You don't need to install any extension, just add this to you User settings.json file in VSCode at the end of the file, and it will work like a charm.

"emmet.showSuggestionsAsSnippets": true,
"emmet.includeLanguages": {"html.erb": "html", "erb": "html"}

More info about emmet suggestion ordering

Install Auto Close Tag Extension

html.erb file is included by default

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM