Auto Generation of u1>li*3 Possible


#1

Auto Generation of u1>li3 Possible → Please watch this very old video. The author types "u1>li3 " and then press some button and the list generates. See this Video → http://www.screencast.com/t/m7NW2MIAlN

Is this possible in atom?

Snippet creation is one thing, but snippet will be static like we can create one for “u1>li*3”, but what if we have to generate 4,5,6,9_____ etc list?

In short can we do it like the way Jeff is doing it in Sublime.

Thanks!


#2

He types ul>li*3, not u1.

The way I do it is with two snippets, one to get the list started and one for adding another item.

'.text.html':
  'Unordered List':
    prefix: 'ul'
    body: """
      <ul class="$1" name="$2">
        <li>$3</li>
        <li>$4</li>
        <li>$5</li>
      </ul>
    """
  'Ordered List':
    prefix: 'ol'
    body: """
      <ol class="$1" name="$2">
        <li>$3</li>
        <li>$4</li>
        <li>$5</li>
      </ol>
    """
  'List Item':
    prefix: 'li'
    body: '<li>$1</li>'

#3

Thanks sir, but can your snippet create variable list like 5,6 or even 13, for example?


#4

No. Atom’s snippet function can’t do that by itself. That would require some code in init.coffee or a package.


#5

Yes. You need to install the Emmet package.


#6

Thanks, I am going to install it now.


#7

Sir, Can you also check my this post → Auto Prefix Creater in Atom,