Extend live templates in several ways to make non-java (web?) developers able to implement and use templates like used in
ZenCoding selectors.
In particular, to allow easy creation of nested HTML/XML structures:
- Ability to capture rest of string as "argument" i.e. aTemplateName<caret>Some-Other&PossibleLong#Text should trigger aTemplateName template and pass Some-Other&PossibleLong#Text to dedicated template variable i.e. $ARG
- Ability to extract parts of vaiables, especially $ARG via regular expressions into new variables (from template code)
- Ability to trigger additional (other or same) template expansion from template code of just expanded via special command i.e. $$EXPAND
Additional ideas may be found in original ZenCoding proposas, however implementing these 3 items will be a really great start.
To allow creation of repetitive blocks:
- Ability to use multipliers i.e. expand aTemplateName*5<caret>OtherText to 5 sequental instances of aTemplateName template
There are several demos of using ZenCoding for HTML from concept authors and implementors, one of them
http://vimeo.com/7405114 showing Espresso implementation. Same is already achived in TextMate and several other editors.
e.g. define live template xxx which consists of $xxx$ variable, specify value for variable groovyScript("_editor.selectionModel.selectLineAtCaret()") and live template scope
Btw, Control (Meta) + Shift + Delete removes enclosing xml tag when editing xml / html
expand with tab, works in HTML & CSS
Use tutorial on Zen Site %)
Also mind that this is "Work in progress"
Only the simplest shortcuts is working: div.class, div#class, div+div, div*5
Shortcuts like div > div, ul>li*>a is not working.
Is this bug or not?
If you taking about "Surround each line" or something else - no additional features will fit 1.0 timeframe, as described in RC release notes.
This is really demanded thing for web markup. It is very bored to manually wrap each line of menu text width <li><a href=""></a></li>
Looks like "surround each line" will go into 1.x only. Its EAP will follow in a month.