Open BigTolly opened 3 years ago
It's better to use native Sublime Text snippets in your case. If you still want to create Emmet snippet, you should wrap custom text with {}
, e.g. {console.log()}
.
Emmet snippets are actually aliases for Emmet abbreviations, you define output structure with it
{ "config": { "html": { "snippets": { "cl": "{console.log();}, // it works in html } }, "css" : { "snippets" : { "cl": "{console.log();}, // it works in css } }, "markup" : { "snippets" : { "cl": "{console.log();}" // it doesn't work in js (javascript) } } } }
Not sure what you mean. Emmet doesn't work in JS by default, only in JSX with prefixed mode: https://github.com/emmetio/sublime-text-plugin#jsx-support
OK, thanks.
For example, how to do this:
"cl": "console.log(' $ ');"
$ - cursorEmmet.subling-settings: { "config": { "html": { "snippets": { "test": ".gg", // working "c": "{Hello}", // working } }, "css" : { "snippets" : { "pss" : "padding: 1px 2px 1px 2px;" // working } }, "markup" : { "snippets" : { "cl": "console.log();" // does not work } } } }