thetooi / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

New action proposal: Smart tag dublicate #119

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is a little feature in the Zen HTML textmate bundle: 
pressing "tab" after closing tag of LI element creates a new LI 
right after on a new line.

I think in zen-coding must be a similar feature, but much more 
smart:

1. We have some block of code like <li><a 
href="#smth">something</a></li>.

2. We have a cursor somewhere on or near </li>.

3. We press a shortcut for proposed action.

4. The action creates a duplicate of the tag scope, but with 
content and attributes replaced by "tab stops" like <li><a 
href="$1">$2</a></li>$0

I think it can greatly improve and simplify copypasting etc.

Original issue reported on code.google.com by kizmarh on 25 Feb 2010 at 4:44

GoogleCodeExporter commented 9 years ago
Hm-m, Select Tag/Balance Tag (editor dependent) → Cmd+C → Cmd-V… Insert 
(formatted) line-break if you wish.

Original comment by GreLIm...@gmail.com on 2 Jan 2011 at 8:10

GoogleCodeExporter commented 9 years ago
The key words are "tab stops" and "content" — for example after using the 
command after <li class="blahblah">Some <a class="ololo" 
href="/whatever/">Things</a></li> it would generate new line with <li 
class="blahblah">$1 <a class="ololo" href="$3">$2</a></li>$4 tab stops.

The key feature, again, is to strip all content that can vary and replace it 
with tab stops.

Original comment by kizmarh on 2 Jan 2011 at 8:28