Sublime Forum

Zen Coding ( CSS Snippets )

#155

Hello, I’m having an issue. I use encoded images (data-uri images) in my css and I have string with something like that ‘fZHTuLCd4eMG7DV4buzZ7mQBpb569Fn883w1o4JlMLYrQ1C2mjJmv2U’, now ‘fz’ don’t turn into ‘font-size:;’ - in turn into first example.

Here are steps to reproduce:
Open new tab, set css syntax;
Use following sample:
{
fz
}
{
fZHTuLCd4eMG7DV4buzZ7mQBpb569Fn883w1o4JlMLYrQ1C2mjJmv2U
}

Click tab after fz - it will turn into ‘fZHTuLCd4eMG7DV4buzZ7mQBpb569Fn883w1o4JlMLYrQ1C2mjJmv2U’

I use v2111. If it don’t turn for you - try to play with css a little, then try again.

Any way to fix this? Thank you for zen coding on sublime!

0 Likes

#156

[quote=“sublimator”]What other ctrl+alt+ bindings are off limits for alt_gr folks?

I made a context for ctrl+alt+n anyway: {“operand”: false, “operator”: “equal”, “key”: “setting.alt_gr”}

If you set "alt_gr": true in your User\Base File.sublime-settings it should be picked up.
[/quote]

Thank you. That fixed the “ctrl+alt+n” problem. However, I still can’t enter the “@” character anywhere in ST2. Not even in the find/replace dialog.

0 Likes

#157

Look like commit 0a7ad5343b75 enable debug by default, which run log_commands(True).
By the way, thanks sublimator for your commitment to this wonderful plugin.

0 Likes

#158

Thanks, that did the trick.

0 Likes

#159

@sublimator, in your screencast in the first page… how did you end up with a multiline selection to start writing inside all the

  • tags right after you wrote the “*5” in the zen code?
  • 0 Likes

    #160

    I really enjoy ZenCoding in other editors, but I don’t quite understand the following behavior:

    * { m! }
    When I hit [TAB] now, it’s working as expected and expands into this:

    * { margin:!; }
    I then go on and add other styles. But when I have something like this:

    * {
       margin:0;
    }
    
    body {
      m!
    }

    and now hit [TAB] I get the following:

    * {
       margin:0;
    }
    
    body {
      margin!
    }

    Completions like m:a do always work, but m:2 to m:4 don’t work using the TAB-Trigger. What puzzles me the most is that when I enable the debug mode the console tells me the right completion:

    * { m:4! }

    When I hit [TAB] it prints this into the console but no completion:

    ZenCoding: on_query_completions expand_abbr abbr: u'm:4' result: u'margin:0 0 0 0;'[/code]
    
    I have found that when you put a dot (.) or a hash-mark (#) the expansions always work:
    [code]* {
      m:4#!
      padding:0;
    }
    
    body {
      p.!
    }

    Successfully expands to:

    [code]* {
    margin:0 0 0 0;!
    padding:0;
    }

    body {
    padding:!;
    }
    [/code]

    0 Likes

    #161

    Awesome! I’ts working perfectly now. :smile:

    0 Likes

    #162

    [quote=“sublimator”]The plugins are implemented via defining an on_query_completion callback that returns a list of candidates…

    Then Sublime compiles the lot and finds the best match.

    Unfortunately there’s no way to fix the problem you mention. There’s no way to disable the words in buffer completion.[/quote]

    Another try :smile:
    Is it possible to check words in auto-complete box and select candidate which is relevant to zen-coding? For example if I will click ctrl+space after ‘fz’, then I will have list on candidates - ‘fZHTuLCd4eMG7DV4buzZ7mQBpb569Fn883w1o4JlMLYrQ1C2mjJmv2U’, ‘fz’ and from there I can select right candidate.
    I’m not sure if API provide access to auto-complete, but I guess there could be a way to automate this when pressing tab. So if I typed ‘fz’ then tab - it should turn to ‘font-size’, if I typed ‘fzh’ - then it can turn to ‘fZHTuLCd4eMG7DV4buzZ7mQBpb569Fn883w1o4JlMLYrQ1C2mjJmv2U’.

    Hopefully this make sense.

    0 Likes

    #163

    Any chance we can get this lil guy going on a GitHub Repository, I think you could get some extra contributors from there (myself included)

    0 Likes

    #164

    Soon I will get new book about Python, learn it and definitely support this plugin. Anyway, thank you for making this plugin - this and multiple selections forced me to love sublime! :smile:

    0 Likes

    #165

    [quote=“sublimator”]@kuroir

    If you’d like to take over maintaining this that would be great. If that means moving it to GitHub then that’s up to you :smile:

    I’m really not the right person for this as I barely use it.[/quote]

    Sounds good to me, though I’m beginning getting used to Sublime. I finally decided to stop using TextMate.

    I’m a front-end engineer so I believe that I can take care of this one, though I’m not that good with Python yet (I’m a Ruby Developer, shouldn’t be that hard I hope).

    This would be great since that could mean that I could take Zen Coding functionality out of my SCSS (Sass) package.

    Any chance you can point me out to some docs about how everything works on the current package? anything would help.

    0 Likes

    #166

    [quote=“sublimator”]@kuroir

    If you’d like to take over maintaining this that would be great. If that means moving it to GitHub then that’s up to you :smile:

    I’m really not the right person for this as I barely use it.[/quote]

    Sounds good to me, though I’m beginning getting used to Sublime. I finally decided to stop using TextMate.

    I’m a front-end engineer so I believe that I can take care of this one, though I’m not that good with Python yet (I’m a Ruby Developer, shouldn’t be that hard I hope).

    This would be great since that could mean that I could take Zen Coding functionality out of my SCSS (Sass) package.

    Any chance you can point me out to some docs about how everything works on the current package? anything would help.

    0 Likes

    #167

    Sublimator,

    I upgrade ZenCoding to current state and now ‘.’ and ‘#’ in html tags didn’t work. I try set “auto_id_class” : true, but nothing happens.

    Maybe I doing something wrong or it is some bug?

    0 Likes

    #168

    I editing them in the zen-coding.sublime-settings, this part:

            // If `true` will insert id="$1" snippet on pressing '#', similar on '.'
            // Useful for `raw html`, but annoying for some templating langs.
            "auto_id_class" : true

    Yes, I think it’s ok.

    0 Likes

    #169

    Copy this settings to ‘User/Base File.sublime-settings’:

        "File Settings" :       {
            // If `true` will disable ctrl+alt+n binding
            "alt_gr"        : false,
            // If `true` will insert id="$1" snippet on pressing '#', similar on '.'
            // Useful for `raw html`, but annoying for some templating langs.
            "auto_id_class" : true
        }

    Nothing happens.

    And for placing one space in css rules it must be added “filters”: “html,css,fc”?

            "css": {
                "filters": "html,css,fc",
                "snippets": {
                    "c": "color:#${1:000000};"
                }
            }

    Not working for me :frowning:

    0 Likes

    #170

    Oh, now it works. It was needed copy to Base File only “auto_id_class”: true :smile:
    Sublimator, thank you!

    But how to enable ‘fc’ filter I not understand :frowning:

    0 Likes

    #171

    Thanks! :wink:

    0 Likes

    #172

    Output:

    u'html,css,fc'

    Yes, I have zen-settings.sublime-settings in User/
    Both of zen-settings.sublime-settings is identical.

    0 Likes

    #173

    You right!

    Now I understand how it works. Sorry for distraction.

    0 Likes

    #174

    hey, i was searching for class and ID thing, thanx a lot!

    also a feedback. i discovered that when i wrap something with “enter haiku” [opn+shft+w], it corrupts the page encoding or maybe adds a hidden character somehow. my local php server displays a white page to me after i used that. i don’t know its directly related with zen coding snippet though.

    0 Likes