Answer the question
In order to leave comments, you need to log in
Changing Emmet templates in Sublime?
Good afternoon!
Probably everyone knows that emmet has a wonderful ability to deploy ready-made templates. For html5 when typing ! and pressing tab expands
!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
there should be a full map of snippets somewhere, but in principle it is possible like this:
Preferences -> Package Settings -> Emmet -> Settings - User
And there, for example:
{
"snippets": {
"css": {
"abbreviations": {
"dib": "display: inline-block;\n*display: inline;\n*zoom: 1;"
}
}
}
}
C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\Emmet\emmetin the snippets.json file
emmet has a snippets.json file that stores mappings between shortcodes and the deployed code. You can fix it, but when you upgrade, you can lose everything.
https://github.com/sergeche/emmet-sublime/blob/mas...
But it would be more correct to write your abbreviations in the settings file. Since it has a higher priority, you can override the default abbreviations.
Example:
In the file above on line 645 the code is "!": "html:5"
This means enter ! and tab call another abbreviation html:5 on line772 "html:5": "!!!+doc[lang=${lang}]"
which pulls other snippets
"!!!": "<?xml version=\" 1.0\" encoding=\"UTF-8\"?>"
"doc": "html>(head>
So change what you want in the file Preferences → Package setting → Emmet → Settings User
For me it looks like this
{
// Custom snippets definitions, as per https://github.com/emmetio/emmet/blob/master/lib/snippets.json
"snippets": {
"html": {
"abbreviations": {
"script": "<script type=\"text/javascript\">",
"script:src": "<script type=\"text/javascript\" src=\"\">",
"form": "<form action=\"${1:#}\" method=\"${2:post}\">",
"form:get": "<form action=\"${1:#}\" method=\"get\">",
"form:post": "<form action=\"${1:#}\" method=\"post\">",
"a": "<a href=\"${1:#}\">"
}
}
},
// Output profiles for syntaxes
// http://docs.emmet.io/customization/syntax-profiles/
"syntaxProfiles": {
// Enable XHTML dialect for HTML syntax
"html": "xhtml"
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question