Notepad++ blockwise code fold/unfold (recursive)

code foldingkeyboard shortcutsnotepad

Is there a way to fold/unfold a selected block of code in notepad++?
I am aware of the shortcuts alt0 and altshift0 (Fold/unfold all), but this is not what I am looking for.

I usually start by folding all the code and then unfolding a particular method. In this scenario the individual fold/unfold shortcuts (ctrlaltf OR ctrlaltshiftf) does not come in handy, as it only works on the current (outermost) block, leaving the inner blocks folded…

Best Answer

There is no keyboard command that I know of, but you can use the mouse. Ctrl+click on the [+] in the left margin, and Notepad++ will expand/unfold/uncollapse that block and all its subblocks.

Conversely, Ctrl+click on a [-], and it will fold/collapse that block and all its subblocks. Real intuitive, huh?

Related Question