有没有办法强制Visual Studio Web Essentials插入单引号而不是双引号?
例如,div.col-xs-1
TAB会产生<div class='col-xs-1'></div>
而不是默认的<div class="col-xs-1"></div>
?
我正在使用Visual Studio 2013更新4和Web Essentials 2013 v. 2.5.3。
有没有办法强制Visual Studio Web Essentials插入单引号而不是双引号?
例如,div.col-xs-1
TAB会产生<div class='col-xs-1'></div>
而不是默认的<div class="col-xs-1"></div>
?
我正在使用Visual Studio 2013更新4和Web Essentials 2013 v. 2.5.3。
不想过于晚加入,但在VS code中我遇到了困难,所以我想为仍然有此问题的人提供解决方案。我的解决方案是进入设置(ctrl-,)> 用户设置> 扩展程序> emmet,在首选项下点击“在settings.json中编辑”。在那里,我将此添加到用户设置中:
"emmet.syntaxProfiles": {
"xml": {
"attr_quotes": "single"
},
"html": {
"attr_quotes": "single"
},
"js": {
"attr_quotes": "single",
"self_closing_tag": true
},
"jsx": {
"attr_quotes": "single",
"self_closing_tag": true
}
}
每种语言都可以定义设置。这对我有用。
syntaxProfiles.json
文件,并在其中添加语法配置。如果~/emmet
目录不存在,则需要先创建该目录。~/emmet/syntaxProfiles.json
中添加如下内容:/* 'js' will map files with .js extension to use the js profile*/
/* 'jsx' will map files with .jsx extension to also use the js profile*/
{
"js": "js",
"jsx": "js"
}
在 ~/emmet/profiles.json
中
/* create or add the 'js' profile */
{
"html": {
"attr_quotes": "double"
},
"js": {
"attr_quotes": "single",
"self_closing_tag": true
}
}
这应该适用于大多数编辑器,但我只在atom中尝试过。 https://github.com/emmetio/emmet-atom/issues/68
settings.json
文件中,而不是创建一个单独的文件或目录。 - Anthony