Over a million developers have joined DZone.

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

DZone's Guide to

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

· Java Zone ·
Free Resource

The CMS developers love. Open Source, API-first and Enterprise-grade. Try BloomReach CMS for free.

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!

BloomReach CMS: the API-first CMS of the future. Open-source & enterprise-grade. - As a Java developer, you will feel at home using Maven builds and your favorite IDE (e.g. Eclipse or IntelliJ) and continuous integration server (e.g. Jenkins). Manage your Java objects using Spring Framework, write your templates in JSP or Freemarker. Try for free.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}