I have a large text code and want to collapse/expand some part of the code that I want. Intellij Idea 13 can do it on some predefined block with CTRL+SHIFT+ NUMPad -/+ , But I want to define my own block and collapse/expand it.
You have several options to fold a custom block.
IntelliJ Idea 14: Select multiple lines and press Ctrl+Period.
Previous IntelliJ Idea versions:
Surround multiple lines with {...} (press Ctrl+Alt+T). Then you can use the fold/expand icons.
Folding by comment:
Visual Studio style:
#region Description
your code
#endregion
NetBeans style:
// <editor-fold desc="Description">
your code
// </editor-fold>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With