Home Download Buy Blog Forum Support

Incremental Multi-Select Character

Incremental Multi-Select Character

Postby jamy_za on Thu Jan 05, 2012 7:09 am

Does this exist?

My goal is:
Code: Select all
<li><a href="#">image 1</a></li>
<li><a href="#">image 2</a></li>
<li><a href="#">image 3</a></li>
<li><a href="#">image 4</a></li>
<li><a href="#">image 5</a></li>
<li><a href="#">image 6</a></li>


I often multi select a couple of lines and start typing something like this:
Code: Select all
<li><a href="#">image</a></li>

I then go back and manually add the numbers. Is there a way around this?
jamy_za
 
Posts: 22
Joined: Mon Jul 04, 2011 1:11 pm

Re: Incremental Multi-Select Character

Postby vitaLee on Thu Jan 05, 2012 11:00 am

install ZenCoding and you'll be able go generate this by writing this
Code: Select all
li*6>a[href=#]{image $}

and hitting tab.
search the forum for more info on how to install ZenCoding.
more info about the plugin itself over here http://code.google.com/p/zen-coding/
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Incremental Multi-Select Character

Postby jamy_za on Thu Jan 05, 2012 12:28 pm

Thanks vitaLee.

I'm trying to avoid anything external. I feel like this is something SublimeText2 should have by default.

Does anyone know if it does exist? If not I think I'll drop this request in the 'Ideas and feature request' section.
jamy_za
 
Posts: 22
Joined: Mon Jul 04, 2011 1:11 pm

Re: Incremental Multi-Select Character

Postby svenax on Thu Jan 05, 2012 1:13 pm

jamy_za wrote:I'm trying to avoid anything external. I feel like this is something SublimeText2 should have by default.


Wait, what? Avoid using plugin packages? The whole point with an extendable editor like SublimeText is that everything does not have to be included by default. If you are avoiding all plugins you are missing out a lot.
svenax
 
Posts: 151
Joined: Tue Dec 20, 2011 12:47 pm

Re: Incremental Multi-Select Character

Postby bizoo on Thu Jan 05, 2012 1:46 pm

svenax wrote:
jamy_za wrote:I'm trying to avoid anything external. I feel like this is something SublimeText2 should have by default.


Wait, what? Avoid using plugin packages? The whole point with an extendable editor like SublimeText is that everything does not have to be included by default. If you are avoiding all plugins you are missing out a lot.

Agree, and I don't think this feature need to be in the core.

If you don't want to use external plugins, just write it yourself.
What you want is very easy to achieve and a good start to learn ST2 plugin framework.
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Incremental Multi-Select Character

Postby jamy_za on Thu Jan 05, 2012 1:59 pm

Cool, thanks guys. Ok yeah I'll try and write the plugin myself. I don't mind adding plugins but installing zen-coding for a small need like I have isn't something I'm excited to do.
jamy_za
 
Posts: 22
Joined: Mon Jul 04, 2011 1:11 pm

Re: Incremental Multi-Select Character

Postby jonathan on Thu Jan 05, 2012 2:25 pm

@jamy_za, seriously, installing Zen Coding is a piece of cake if you have Package Control installed. Simply cmd+shift+p, type "Install Package", select "ZenCoding" and wait. :)

And installing package control is super easy too, just run one command and restart. More details here:

http://wbond.net/sublime_packages/package_control/installation
jonathan
 
Posts: 22
Joined: Tue Aug 30, 2011 12:42 pm

Re: Incremental Multi-Select Character

Postby bizoo on Thu Jan 05, 2012 2:34 pm

jamy_za wrote:Cool, thanks guys. Ok yeah I'll try and write the plugin myself. I don't mind adding plugins but installing zen-coding for a small need like I have isn't something I'm excited to do.

I don't code HTML so ZenCoding is not very useful for me either, so I understand that if you only need this feature installing ZenCoding is a little bit overkill.
If you need some help for your plugin, feel free to ask on this forum. People are usually nice and helpful here.
Good luck.

Edit: I just remember someone already make something like that http://www.sublimetext.com/forum/viewtopic.php?f=5&t=1604&p=8591&hilit=increment#p7311
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to General Discussion

Who is online

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