SublimeText3 Fold/Unfold all methods

后端 未结 4 1111
无人及你
无人及你 2021-02-04 23:55

I am using SublimeText3 for C++ and Java. I am wondering if there is a way to fold all of the methods in a file / class, and then unfold them all, regardless of where the caret

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 00:52

    Using the Sublime Text 3 menu, you can find EDIT -> Code Folding -> which exposes the folding methods and will helpfully tell you the default keyboard shortcuts they are assigned to.

    By default you press Ctrl+K, then Ctrl+1 to fold all subroutines. Then, to unfold all I would press Ctrl+K then Ctrl+J.

    If this does not work for your file type / syntax, try Ctrl+K, Ctrl+2 and above to see if another folding level works for you.

    Unfortunately for me, the proprietary code I work with required custom syntax and a custom function written in our in-house package to fold all of our functions (a new sublime command written in python and installed as a package).

提交回复
热议问题