Search code examples
visual-studio-codeselectionexpand

How to fold/expand all functions in a selection in Visual Studio Code


Is there a way to fold/expand a large selection of functions(javascript code) in Visual Studio Code?


Solution

  • ctrlkctrl0 will fold all:

    all folded

    and

    ctrlkctrlj will unfold all

    But it works on the whole file, not on a selection. You can also fold only a certailn level with the commands

    ctrlkctrl1 ... ctrlkctrl9 for level 1 ... 9

    You find these shortcuts in the keyboard shortcuts: ctrlkctrls