The combination ctrl+' can be used to fold/unfold a selected group.
Is there a way to fold/unfold all cells at a given nesting level, and possibly also to fold/unfold all groups?
I'm thinking something along the lines of ctrl+k ctrl+j, ctrl+k ctrl+1 and so on, that are used for these kinds of folding actions in Visual Studio Code, Atom, and possibly other editors.
Given that in a Mathematica notebook the "nesting" works different than in a regular code editor (no nesting inside code for one), by "nesting level" I here mean to fold/unfold all chapters, sections, subsections and so on.
Edit: I've just found this other post where Kuba gives a function to open/close all groups at a given level. It therefore only remains to find a way to bind this to the appropriate keyboard shortcuts.
I'm however not sure how to use the above mentioned bindings to do this.
KeyEventTranslations.trfor'or words related to grouping/folding doesn't give me anything – glS Aug 27 '17 at 16:55OpenCloseGroup. Still I cannot seem to make it work from the front end. Something likeFrontEndExecute@FrontEndToken[EvaluationNotebook[], "OpenCloseGroup"]does nothing – glS Aug 27 '17 at 17:03SelectionMove[PreviousCell[], All, CellGroup]; FrontEndTokenExecute[ParentNotebook@PreviousCell[], "OpenCloseGroup"]– b3m2a1 Aug 27 '17 at 17:04... KeyEvent["k1", Modifiers -> {Control}] ...does not work. I'm trying to have a command execute when pressing two characters in succession whilectrlis down – glS Aug 27 '17 at 18:20