Home Download Buy Blog Forum Support

Zen Coding and curly braces

Zen Coding and curly braces

Postby ancarius on Sat Mar 03, 2012 2:25 pm

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.
ancarius
 
Posts: 2
Joined: Sat Mar 03, 2012 2:19 pm

Re: Zen Coding and curly braces

Postby agibsonsw on Sat Mar 03, 2012 8:51 pm

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.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Zen Coding and curly braces

Postby agibsonsw on Sat Mar 03, 2012 8:56 pm

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 :?:
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 20 guests