How to expand/collapse all blocks of ruby code in notepad++?

49

5

Is there any way how to collapse all blocks in ruby code in Notepad++?

It is much easy to navigate the code of functions, routes in Sinatra and blocks in rufus if all blocks are collapsed.

Radek

Posted 2012-06-12T23:10:20.633

Reputation: 2 914

Answers

63

You can use the options under view.

The one that you are looking for is Fold all but you might find some of the other fold/collapse ones helpful.

soandos

Posted 2012-06-12T23:10:20.633

Reputation: 22 744

This shortcurt also works for XML code. – Stephan – 2016-03-11T14:23:49.440

57The shortcut is alt+0 for fold all and alt+shift+0 for unfold all. Thank you. – Radek – 2012-06-12T23:55:45.913

2If the shortcut is not working for you, make sure you use the 0 above the letter keys, the one on the numpad doesn't seem to work (with an AZERTY keyboard). – Stijn – 2014-04-03T15:24:49.997

Or my QWERTY keyboard FYI @Stijn – Jeff – 2014-06-12T21:17:28.813

21

Short Cuts to collapse & expand :

1) To collapse/fold all blocks - Alt+0

2) To expand/unfold all blocks - Alt+Shift+0

3) To collapse current level - Ctrl+Alt+F

4) To expand current level - Ctrl+Shift+Alt+F

The above question's superset is as follows : Notepad++ expand/collapse block with keyboard

Steve Jobs

Posted 2012-06-12T23:10:20.633

Reputation: 311

8

Just to complement the answers posted before, I would like to add that it is possible to collapse the levels of nesting on a level of 1 to 8 with the following shortcut alt + [nesting level] like so:

Nesting level 1: alt + 1

Nesting level 2: alt + 2

Nesting level 3: alt + 3

Nesting level 4: alt + 4

Nesting level 5: alt + 5

Nesting level 6: alt + 6

Nesting level 7: alt + 7

Nesting level 8: alt + 8

Amadeus Sánchez

Posted 2012-06-12T23:10:20.633

Reputation: 195

2This deserves so much more upvotes. – Mickael Bergeron Néron – 2016-08-16T14:43:13.313