Of course, this article is not ready to praise St, but for how to use good emmet this powerful tool and write!
In addition to the powerful features above, Emmet can also customize snippets. For example: bd+ + TAB Output border:1px solid #000, we can rewrite Emmet extended directory Snippets.json file can be implemented snippets rewrite!
Sublime Text3 not like sublime Text2 can directly find Emmet Snippets.json files, to the St directory packagesuser manually create a Emmet directory, and create a Snippets.json file in the directory that defines the reference link by default:
Https://github.com/emmetio/emmet/blob/master/snippets.json
We simply rewrite the snippets that we want to redefine, as shown in the Snippets.json definition:
The code is as follows |
Copy Code |
{ "CSS": { "Filters": "HTML", "Snippets": { "bd+": "border:${1:1px} ${2:solid} #${3:f00};", } } } |
The red part is the main overriding content, rewrite the rules, detailed visible:
http://docs.emmet.io/customization/snippets/
After overriding the rule, you also specify the extension path manually in the Emmet.sublime-settings file, as follows:
The code is as follows |
Copy Code |
{ "Extensions_path": "E:/sublime Text build 3061 X64/data/packages/user/emmet" } |
After testing, Extensions_path only support absolute path, the relative path can not be recognized!
It is noteworthy that, according to the official description:
http://docs.emmet.io/css-abbreviations/vendor-prefixes/
The CSS3 property is the default smart plus browser prefix output, such as: BDRs output
The code is as follows |
Copy Code |
-webkit-border-radius:; -moz-border-radius:; Border-radius:; |
I tried to rewrite the BDRs, so that it does not have the browser prefix output, but found that the official method can not find, I do not know whether to achieve, there are know how to achieve the method of netizens, please inform, not very grateful!