So Eclipse can auto-format my css files under Source->Format, or by hitting Cntl-Shift-F.
When I group selectors for a single rule, eclipse formats it like this:
.planner th,.planner td {
border: 1px solid black;
}
I would really like Eclipse to add a space between the selectors to aide readability, like this:
.planner th, .planner td {
border: 1px solid black;
}
Is there any way I can configure Eclipse to do this? I'm running Eclipse Indigo.
Eclipse Web Developer Tools Includes the HTML, CSS, and JSON Editors, and JavaScript Development Tools from the Eclipse Web Tools Platform project, aimed at supporting client-side web development and node. js applications.
It can reside in the same folder where your html/jsp page resides, or it can reside in any sub folder within that too. But accordingly to you have to specify the path. Deploy them in subdirectories under "[your-project]/WebContent". I usually name the subdirectories "js" and "css".
The Aptana Studio plugin for eclipse has a formatter that's pre-configured according to your needs.
I recommend using it regardless as it ease up the development process a great deal for web developers (all sorts of nifty features like built-in Git integration, code assist for common JavaScript libraries, integrated FTP client, embedded AJAX server [Jaxer], nice themes included, etcetera, etcetera...).
References:
The easiest way to solve your problem would be to run a find/replace command like so.
Ctrl
+F
) on the CSS file.,\.
, \.
regular expressions
box.Replace All
.Alternatively If your want can't be configure through the CSS editor (which seems to be so), then you're going to have to make a plugin for it.
CSS Editor is located here:
Preferences > Web > CSS Files > Editor
If you're considering making a plugin, then check out the package org.eclipse.jdt.core.formatter
for help.
More information here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With