The IDE can fold functions. For larger files, I use the "Fold all" menu function to get an overview. With "Unfold all" everything is unfolded again. As I have already argued in this forum: All IDEs I know have this function, Arduino again not.
Pressing F1 lists the keyboards sequences for "Fold All" and "Unfold All"
On the nightly 20210409
Fold All : Ctrl + K Ctrl + 0 Unfold All : Ctrl + K Ctrl + J
To Phaedra: OK - but it should be visible in the Edit menu too. Is it? I'm not the user of crypic control sequences.
I decided to post my question here since we are talking folding of code.
I find the new folding, which seems to use indenting to select regions, a mess. The convention, at least mine and Auto Format (which now seems to be working in Beta 5 - thanks), places all preprocessor directives and also, in my case, the double slash to comment out code, starting in column 1. That totally messes up folding since it folds from column 1 to the next column 1.
If I have a preprocessor directive as the first instruction in a function, I do not even get the little down arrow in the gutter next to the function header. Only at the #ifdef of that first instruction (which then folds to the next #else etc).
Is it possible to switch to the method used in the Classic IDE (maybe as an option). Nested open and closing curly bracket pairs decided the folding and worked great. With a single click I could fully fold a function.
ctrl-K on a mac kills the text till the end f the line
there is no F1 key on my keyboard
→ this should really make it to the menu
Starting with Arduino IDE 2.0.0-beta.5, you can customize the keyboard shortcuts via File > Advanced > Keyboard Shortcuts.
The alternative shortcut for the command palette is Cmd + Shift + p.
cool - missed that
(the search goes way beyond the call of duty by not only looking for the word you type but also any sequence of letters that is in the right order… scary (and slow) !!)
It’s supposed to be hard. If it were easy, everyone would do it. lol
I totally agree with you.