Sublime Forum

Zen Coding and curly braces

#1

Ok. So far I’m loving ST2. The theme is awesome and it’s the first editor since TextMate and E Text Editor that really got to me. But there are a couple of things that bug me and was hoping someone could clear them up for me.

For starters the most important reason why I’d switch to ST is because it has Zen Coding integration. And so far this seems to work way better than in E. But with the know-it-all code completion dropdown whenever I try to insert for example fl:l for ‘float:left’ I end up with fl:list-style because of the suggestion the CSS default gives me. Is there a way to disable this or make Zen Coding suggestions the default?

Secondly I find it a tad annoying that whenever I fold a block of code I end up with the end brace just hanging out. Is this the standard or just a preference of the developer and is there a way to include it in the fold?

Cheers.

0 Likes

#2

You could try creating File Settings - Syntax Specific for .css files that, effectively, disables the default auto-completions. Copy all the auto-complete settings from File Settings - Default and tweak them until it behaves, relying on Tab for ZenCoding.

There are a number of Snippets (in folders) in Packages\CSS. If you don’t use these then you could move them out of the Packages area. (They will possibly be reinstated when you next update ST.)

ST seems to have a number of CSS completions *hard-wired *into the app, but if you disable auto-completions then they should interfere less.

I can’t help you with the folding issue. Andy.

0 Likes

#3

Actually, the ST API has the method ‘fold(region)’ where you are in control of defining the region. So it would be possible to create a TextCommand to include the additional curly bracket when folding.

I don’t know if there is an easier way to do this :question:

0 Likes