Home Download Buy Blog Forum Support

Auto comment ending divs with div name?

Auto comment ending divs with div name?

Postby ausprog on Tue Jan 15, 2013 1:19 am

Hi Everybody,
Just curious if there is a plugin or feature to automatically add a comment to the end of a div with the div name. For example:

I would like to type "#wrap" and hit tab, and then be returned with:
Code: Select all
   <div id="wrap">
         
   </div> <!-- end wrap -->


or something similar to the likes. Is there anything that does this at the moment? Been difficult finding a feature like this.

Regards,
ausprog
 
Posts: 13
Joined: Sun Oct 14, 2012 7:58 am

Re: Auto comment ending divs with div name?

Postby handycam on Tue Jan 15, 2013 2:40 am

You could write a snippet to do this.
Mac OS 10.9.3
ST 3 (3059)
handycam
 
Posts: 271
Joined: Tue Jan 03, 2012 2:42 pm

Re: Auto comment ending divs with div name?

Postby iamntz on Tue Jan 15, 2013 6:03 am

There :)
Code: Select all
<snippet>
   <content><![CDATA[
<div class="$1"$2>
   $0
</div><!--/.${1/\s.*//} -->
   ]]></content>
   <tabTrigger>div.</tabTrigger>
   <scope>text.html</scope>
</snippet>
iamntz
 
Posts: 897
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania


Return to General Discussion

Who is online

Users browsing this forum: douglasguo, Exabot [Bot], Google [Bot], pamamolf and 26 guests