Sublime Forum

Zen Coding ( CSS Snippets )

#135

[quote=“sublimator”]

Ok just thought it was me, will ctrl+u the go around

I made it default to an empty string. When I get some time I’ll get around to adding some up/down input history bindings.[/quote]

Thanks for making the change. Will give the new plugin a test.

0 Likes

#136

Hm, after last update wrapping didn’t work for me anymore. But when I try to use wrapping with ZenCoding, undo is broken and do something very ugly :frowning:

0 Likes

#137

Just did a quick test and wrapping works good.
Tomorrow I will test more intensively.
Sublimator, thank you very much!

0 Likes

#138

Now I have not problems with wrapping and undo. But now ZenCoding works not as expected :smile: For example, Enter Koan make all code inline (not formatted) and didn’t place caret to href="|".

0 Likes

#139

http://img26.imageshack.us/img26/5954/errgw.png

See that. I think this is caused by Zen Coding.

Sometimes when i click Preferences … i get this.

I use dev 2096 x64 on Windows 7 but this happens from other dev builds and it still here :smile:

0 Likes

#140

And the problem is caused by zen or by the editor?

0 Likes

#141

Yes. I’ll try tomorrow

0 Likes

#142

It’s almost certainly an issue with Subilme Text 2 itself

0 Likes

#143

A bug has come to light in Zen for me. I think I’m using the most up-to-date version of Zen, and I’m on b2098 of ST2. I think the bug’s been around as long as I’ve known Zen on ST2. Anyway on to the bug:

The main bug here is that in PHP, if I place the caret in the middle of some PHP and hit the alt+shift+w command, any variable references (e.g., ‘$variable’) inside the PHP disappear. My assumption is that it has something to do with the dollar sign followed by word characters means something special which is somehow being clobbered by Zen.

So say you had this HTML:

<span><?php echo 'hi'; ?></span>
<span><?php echo $variable; ?></span>
<span><?php echo $object->property; ?></span>

After wrapping each line individually (for simplicity) you end up with:

<span><a href=""><?php echo 'hi'; ?></a></span>
<span><a href=""><?php echo ; ?></a></span>
<span><a href=""><?php echo ->property; ?></a></span>

Another thing I’m experiencing which may or may not be a bug is that if these PHP snippets weren’t individually wrapped in HTML tags (in this case span but it can be anything in my testing) it treats the three lines of PHP as a single block and therefore will wrap the ‘a’ (in this case) around the three lines as a whole rather than each line getting its own ‘a’. Now, I have a feeling this may be how the plugin is supposed to work, as it will never be able to predict whether an HTML author means a list or a non-breaking paragraph (the normal HTML whitespace rules) by multiple lines with no separating tags. Having said that, I think that for the most part, the preferred behaviour would be broken lines. I know this can be done by selecting multiple lines, pressing c+s+l to split lines, and then Zenning, but I think that default behaviour for Zen really could be straight select then Zen treats the lines as separate entities. I bet that >90% of the time people do that they mean it as if the lines are separate. But feel free to correct me, other developers.

0 Likes

#144

Excellent. Thanks for this. I obviously need to brush up on my Zen, this does exactly what I wanted.

0 Likes

#145

Hi Sublimator,

A few pages back someone posted that they are having an issue using zen with twig bundles. I’m seeing the same bug related to typing a dot within my twig braces (typing a dot causes class=" " to appear.)
You asked for some debug information and I’m not sure if you got it, if you need help looking into this issue then I’ll do what I can.

viewtopic.php?f=2&t=580&start=240#p10958

Anyway you asked for the expression scope - I ran the shortcut you gave - this is what I got (in the info bar in the bottom of my screen)

column 48; punctuation.section.tag.twig meta.tag.template.value.twig text.html.twig

-Cheers

0 Likes

#146

Thanks! For anyone else how is tracking this - this fix is here.
bitbucket.org/sublimator/sublim … 74b64819d4

0 Likes

#147

I’m having trouble with css completions.

When I’m in a CSS file (scope: source.css), completion of some css properties doesn’t work. For instance ‘pos’ becomes ‘progress’ instead of ‘position: ;’. However, most of the mnemonics that have a colon (like ‘pos:s’) work as advertised.

I’m using ST2 Build 2109 and the latest ZenCoding bundle installed via Package Control.

0 Likes

#148

@Sublimator: can this be done in… reverse? I kind of need to remove the zen completion and keep only mine… :smiley:
I only need „zen as you type” feature. Css completion are not my type, to say so.
eg:
re => resize (instead of relative, which is much useful for me)
c => color:#000;| (instead of color:#|[000]:wink:
those are first i found in like 30 seconds.

On the other hand, zen as you type is pure awesomeness that i can’t use because of the css thing :frowning:

Please make a way of disabling parts of the plugin :smiley:

0 Likes

#149

Yeah, I’m using a completion file (it’s come handy to have one file with ~200 lines rather than 200 files :smiley: )

Btw, there is a way of keeping completion only from the completion file, not from the existing file too? There are some weird situation when I really don’t need that. (this is not related to zen in any way though)

My hero! :mrgreen:

0 Likes

#150

Thanks. But… still doesn’t work right.
screencast.com/t/RPmUQu1wKts

0 Likes

#151

The setting is in User/zen-coding.sublime-settings.

Anyhow!
I removed this:

            (CSS,  ( (CSS_SELECTOR,              self.css_selectors),
                     (CSS_VALUE,                 self.css_property_values) )),

From the sublimezenplugin.py and seems to works fine. I mean works exactly like I wanted to work!
(searched for disable_completions in py files and started to remove various things)

So… Thanks! I finally can use this awesome plugin!

/// edit:
After i took a look into default keymap file (on win) i discovered this: without zen, when i’m typing : i automatically get :neutral_face:;. With zen i only get : (i think you should keep the original behavior and only remove it if there is a completion or smth)

0 Likes

#152

Yeah, i get that too, but doesn’t work like it should (and like it works without the lines i mentioned above).
Anyhow, now i’m extremely happy with what i have, so I guess is enough. I hope i won’t forget what i changed on the next update :mrgreen:

Btw, do you have a paypal account? :smiling_imp:

0 Likes

#153

I tried searching but couldn’t find a way to override the keyboard mappings in ZenCoding\Default (Windows).sublime-keymap without editing this file.
Is this possible?

Also, does anyone have any idea why I can’t enter the “@” character anywhere ST2? I’m have a QWERTZ type keyboard, so the keystroke would be AltGr+V. Some keyboard mapping might be overriding it, but how do I find out which one?

0 Likes

#154

[quote=“sublimator”]Bindings can be a bit of PITA with Sublime

You can put bindings in the User/Default*.sublime-keymap

Why do you need to edit it? Conflicts with other packages? Or just don’t like the default bindings?[/quote]

I’m having trouble with the Zen command bound to crtl+alt+n because it’s equal to altgr+n on my keyboard. And I need to be able to press altgr+n because that’s how I enter the right curly bracket ‘}’. But if I change ctrl+alt+n in ZenCoding, it won’t survive upgrading like you said.

Unfortunately, that command logs everything except altgr+v which is the “@” character :frowning:

0 Likes