Sublime Forum

Incremental Multi-Select Character

#1

Does this exist?

My goal is:

[code]

  • image 1
  • image 2
  • image 3
  • image 4
  • image 5
  • image 6
  • [/code]

    I often multi select a couple of lines and start typing something like this:

    <li><a href="#">image</a></li>

    I then go back and manually add the numbers. Is there a way around this?

    0 Likes

    #2

    install ZenCoding and you’ll be able go generate this by writing this

    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/

    0 Likes

    #3

    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.

    0 Likes

    #4

    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.

    0 Likes

    #5

    [quote=“svenax”]

    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.[/quote]

    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.

    0 Likes

    #6

    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.

    0 Likes

    #7

    @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. :smile:

    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

    0 Likes

    #8

    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 https://forum.sublimetext.com/t/insertnums-sequential-alphanumeric-insertion/1220/4&hilit=increment#p7311

    0 Likes