My Weekly NetBeans Tip (2): Comment/Uncomment XML Tags

My tip for this week is similar to my tip from last week. Last week I showed how to surround a selection of Java code with an editor fold. Now I will show how to surround a selection of XML tags with the uncomment tags. When you complete the steps in this tip, then whenever you select XML tags, you will automatically see the small yellow tip with one hint, for surrounding with uncomment:

When you select that hint, you will see this:

     

  1. Go to Tools | Options | Editor | Code templates.

  2. Select XML in the Language
  3. Click New, enter "un" as the abbreviation, then enter the following code as the expanded text:

    <!--
    ${selection line}${cursor}-->

  4. In the Description tab, enter "Uncomment", and click OK.

Now it will work like shown above. The tip is based on my previous tip. Hope you like it!
0
AttachmentSize
surround-with-1.png27.3 KB
surround-with-2.png14.04 KB

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Varun Nischal replied on Thu, 2008/06/26 - 2:18pm

Hi,

My name is Varun Nischal and I'm the NetBeans Community Docs Contribution Coordinator. Your Dzone entries would make fantastic Tips and Tricks for our Community Docs wiki (http://wiki.netbeans.org/CommunityDocs).

If you aren't a Sun Employee, Would you be willing to contribute it? If you need any help or have any questions, please contact me at nvarun@netbeans.org

I look forward to hearing from you.

Thanks,
Varun Nischal
http://nb-community-docs.blogspot.com/
--
"You must do the things you think you cannot do."

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.