Emmet Editor customization to rewrite code snippet: Snippets.json

Source: Internet
Author: User
Tags json sublime text

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.