是否有一个菜单选项或快捷键来折叠侧边栏中所有展开的文件夹?那边一团糟,看起来应该有比一个一个关掉更好的办法。
On OSX: option + left click at the root node.
On windows/linux: control + alt + left click
For Sublime Text 3 on Linux Mint 17.2 w/ Cinnamon I had to disable the following setting:
System Settings->Windows->Behavior->Moving and Resizing Windows->Special key to move and resize windows
After that Alt+left click worked!
using purely keyboard, on a mac, to unfold
CMD + K + 0
to fold, depending on the level of indentation
CMD + K + {level of indentation number} (eg. CMD + K + 2)
Refer here for more details functions of sublime text. Found this really helpful
To collapse all expanded folders in the sidebar on macOS:
ctrl + 0
home
cmd + up
ctrl + left
alt
right
Thanks to the existing responses that provided this info.
I've not tested on other platforms, please update the answer if you can.
In Sublime Text 4, pressing "option/alt" on your keyboard and clicking a folder in Sublime's sidebar with your mouse, will collapse all sub-folders within the folder you clicked. I'm using a Mac. I'm not sure what happens on other operating systems.