折叠升华文本2中的所有扩展侧边栏文件夹

是否有一个菜单选项或快捷键来折叠侧边栏中所有展开的文件夹?那边一团糟,看起来应该有比一个一个关掉更好的办法。

17562 次浏览

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

Keyboard only

To collapse all expanded folders in the sidebar on macOS:

  1. ctrl + 0: Focus the sidebar
  2. home or cmd + up: Select first root folder
  3. ctrl + left: Collapse all sub-folders (confusingly, not alt as per the equivalent mouse action).
  4. (optional) right: Expand just the top level folder.

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.