-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting CSS properties in a single line (compact format) #114
Comments
OK, I’ll add a preference for this |
Awesome, Tnx! |
You can make Emmet output chained CSS properties with {
"css": {
"filters": "s"
}
} |
Where do I find I looked into Thanks. |
https://github.com/sergeche/emmet-sublime#extensions-support You have to create this file |
Leaving old steps at the bottom for reference. Steps to get this working in Windows 7, you may have to interpret folder paths if you're in WinXP or something else:
A million Thanks to Sergeche for his dedication to make this feature available.
|
In this case, you don’t need to add |
Sergeche, if I don't add Doing this: Doing this:
(See also my PS in my post above) |
Looks like it was a bug in profile handler. I’ve just pushed update, check if default filters for CSS syntax works for you (e.g. add |
It still doesn't work if I don't use the filter Not sure if your update has anything to do with this: In my home PC I removed ZenCoding and made a fresh install of Emmet (I was posting/working from my work laptop in the above posts). I decided to keep it simple and not do any of the steps above and test: first without the Doing this:
As expected, I haven't done any changes to any files yet. Howver, doing this: So, it does work but only if I use the filter Then I went ahead and did all the steps above, created the syntaxProfiles.json file, added Same case as above: without the filter CSS properties expand to multiple lines. With filter, CSS properties expand to compact/chained rules. Thanks. |
Oh, looks like you’ve placed |
I placed the syntaxProfiles.json in: Even restarted ST2. Actually, I always restart it just in case, I know some plugins don't require you to restart ST2. Thanks. |
Please read my previous comment carefully: this path is invalid. You should either place |
Got it, I thought you had made a mistake typing the folder path. Compact/chained properties format works perfect! Thank You! For anyone else reading this issue: The folder Just type Thanks a million to Sergeche, his dedication to have this working was exemplary. Steps above for getting this option working are updated. |
After a lot of trying I'm still not able to produce the automatic single line functionality. I've tried adding the setting to my Any suggestions? I'm running ST2 in OSX. |
@pietvanzoen can you show me your |
{
// Copy any modified settings to `User/Emmet.sublime-settings`
// otherwise modifications will not survive updates.
// Path to folder where Emmet should look for extensions
// http://docs.emmet.io/customization/
"extensions_path": "~/emmet",
// Disable completions of HTML attributes
// with this option disabled, you can get attribute list completions
// inside opening HTML tags.
// WARNING: with this option disabled, Tab key expander will not
// work inside opening HTML attributes
"disable_completions": false,
// With this option enabled, all Emmet's CSS snippets
// will be available in standard auto-complete popup
"show_css_completions": true,
// List of scopes where Emmet CSS completions should be available
"css_completions_scope": "source.css - meta.selector.css - meta.property-value.css, source.scss - meta.selector.scss - meta.property-value.scss",
// Remove default HTML tag completions on plugin start
// You should restart editor after changing this option
"remove_html_completions": false,
// A comma-separated list of scopes where Emmet’s Tab key
// abbreviation expander should be disabled
"disable_tab_abbreviations_for_scopes": "",
// A regexp for scope name: if it matches, Tab handler won’t work
// The reason to use this preference is that ST2 has buggy scope matcher
// which may still trigger Tab handler even if it's restricted by context
"disable_tab_abbreviations_for_regexp": "source\\.(?!css).+?\\stext\\.html",
// Exit tabstop mode when enter key is pressed
"clear_fields_on_enter_key": true,
// A comma-separated list of disabled action names.
// Listed action will not be triggered by default keyboard
// shortcut.
// Use "all" value to disable all shortcuts at once
"disabled_keymap_actions": "",
// By default, Emmet overrides Tab key to effectively expand abbreviations.
// The downside of this approach is that you can’t expand regular ST2
// snippets (like `php`). Since it’s not currently possible to get a list
// of ST2 snippets via API, you can provide a list of scopes where Emmet’s
// Tab trigger should be disabled when expanding simple abbreviation.
// If entered abbreviation (like `php`) wasn’t found in Emmet snippets list
// or "known_html_tags" preference, Tab handler will not be triggered.
// Leave this setting blank to disable this feature
"disabled_single_snippet_for_scopes": "text.html",
// A space separated list of all known HTML tags,
// used together with "disabled_on_single_snippets" option
"known_html_tags": "html head title base link meta style script noscript body section nav article aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr pre blockquote ol ul li dl dt dd figure figcaption div a em strong small s cite q dfn abbr data time code var samp kbd sub sup i b u mark ruby rt rp bdi bdo span br wbr ins del img iframe embed object param video audio source track canvas map area svg math table caption colgroup col tbody thead tfoot tr td th form fieldset legend label input button select datalist optgroup option textarea keygen output progress meter details summary command menu",
"empty_elements": "area base basefont br col frame hr img input isindex link meta param embed",
// If set to `true`, Emmet will automatically insert final tabstop
// at the end of expanded abbreviation
"insert_final_tabstop": false,
// Try to automatically detect XHTML dialect in HTML documents.
// With this option enabled, your custom profile for HTML documents may not work.
"autodetect_xhtml": true,
///////////////////////////////
// Emmet customization
// Each section has the same meaning as the same-named JSON file
// described here:
// http://docs.emmet.io/customization/
///////////////////////////////
// Custom snippets definitions, as per https://github.com/emmetio/emmet/blob/master/snippets.json
"snippets": {
// "html": {
// "abbreviations": {
// "example": "<div class='example' title='Custom element example'>"
// }
// }
},
// Emmet preferences
// List of all available preferences:
// http://docs.emmet.io/customization/preferences/
"preferences": {
// "css.valueSeparator": ": ",
"css.propertyEnd": "; "
},
// Output profiles for syntaxes
// http://docs.emmet.io/customization/syntax-profiles/
"syntaxProfiles": {
"css": {
"filters": "s"
}
}
} |
Try this: {
"snippets": {
"css": {
"filters": "html, s"
}
}
} |
That worked. Thanks! |
Hello @sergeche. Thanks for a great plugin! I'm also having trouble getting the single line css to work. It doesn't work if I type, for example, "trs" and then hit tab. It displays the transition properties on multiple lines. However, if I then hit ctrl + z to undo and hit tab again it correctly displays it all on a single line. I have created the syntaxProfiles.json in my c:\users\user\emmet directory, which has the following: {
"css": {
"filters": "s"
}
} I have also created Emmet.sublime-settings and have the same settings as the ones pietvanzoen pasted earlier, though I did add: {
"snippets": {
"css": {
"filters": "html, s"
}
}
} as you instructed. However, single line only works when I tab, undo, then tab a second time. Any ideas what I can do to get it to work on the first tab? Thanks so much for a wonderful plugin! |
By default, Tab handle is disabled when autocomplete popup is visible. You can:
|
Perfect, thanks for the help! Awesome work! |
Добрый день! |
@Esvalirion не понял, в чём проблема |
После ":" стоит пробел, а после ";" пробела нет |
А почему после |
Аа, вот оно что! |
When I have single line formatting for CSS enabled, it strips |
Although not an issue per se, I wasn't able to see where I could modify Emmet's default CSS formatting from "expanded" (properties+values each in a single line) to compact (all properties+values in a single line).
For example, Emmet's current CSS default formatting (expanded):
To this style (compact):
header { width:960px; height:120px; }
Any idea how to accomplish this?
Thanks.
The text was updated successfully, but these errors were encountered: