My Weekly NetBeans Tip (1): Surround with Code Folding
1. Go to Tools> Options> Editor> Code templates
2. Click New, enter "cf" as the abbreviation, then enter the following code as the expanded text:
// <editor-fold defaultstate="collapsed" desc=" ${DESCRIPTION} ">
${selection line}${cursor}
// </editor-fold>
3. In the description tab, enter "Code folding", and click Ok
Now, if you select multiple lines of text in the editor, you will get the "light bulb" icon in the margin. Click it, and you'll get the option "Surround with Code folding". Select it, enter a description and you're done.
![]() |
I found this tip here: http://wiki.netbeans.org/SurroundWithCodeFolding. I will be drawing attention here to other of my favorite tips once every week. Others should do the same!
- Login or register to post comments
- 1269 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










