在Sublime Text中关闭所有选项卡,但不关闭窗口

fir*_*dev 59 keyboard-shortcuts shortcut sublimetext sublimetext2 sublimetext3

有没有办法在Sublime Text中一次性关闭所有选项卡,但是保持当前项目打开的窗口?当我只想关闭所有打开的文件并开始Cmd-W逐个启动新任务时,真的很烦人.如果我这样做Cmd-Opt-W将关闭所有选项卡和当前项目.

fir*_*dev 95

感谢Alex,它有点简单,首选项>键绑定>用户:

{ "keys": ["super+shift+w"], "command": "close_all" }

无需重启Sublime,它立即可用.甚至更好,不需要使用新的快捷方式,你仍然可以Cmd-W在所有标签消失后关闭Sublime窗口.


Ale*_*lex 42

文件菜单中有一个选项,但它没有快捷方式:

  • 文件 - >关闭所有文件

编辑 - 更改用户设置:

kay,打开Preferences - > Key Bindings - 用户并在[]之间粘贴以下内容:

{ "keys": ["ctrl+alt+shift+w"], "command": "close_all" }

然后使用Ctrl,Alt,Shift和w关闭所有选项卡.

你必须先重启Sublime.


dem*_*isx 22

这是我在Mac Sublime Text 3上设置的内容

1. Go to Sublime Text -> Preferences -> Key Bindings - User
2. Add the following binding:
[
  ... ... ...
  { "keys": ["command+shift+w"], "command": "close_all" }
]
3. Save file

现在,点击"Command + Shift + W"将关闭所有打开的标签页.点击"Command + W"仅关闭当前选项卡.这与其他应用程序窗口的Mac快捷方式一致.


Von*_*onC 17

默认情况下,关闭所有选项卡不会关闭窗口,但要注意:Sublime Text 3的最后一个版本3059(2013年12月13日)现在包括:

拖出最后一个选项卡时自动关闭窗口

它由以下设置管理:

// Set to true to close windows as soon as the last file is closed, unless
// there's a folder open within the window. This is always enabled on OS X,
// changing it here won't modify the behavior.
"close_windows_when_empty": false,
Run Code Online (Sandbox Code Playgroud)

我只想关闭所有打开的文件并启动新任务

在同一个Sublime Text 3 build 3059中,您还有以下设置:

关闭最后一个文件时,会自动创建一个新的临时文件

结合"文件 - >关闭所有文件",可以帮助您在新文件中快速启动.


Usm*_*med 8

转到首选项>键绑定 - 用户>并添加以下行.

{ "keys": ["super+w"], "command": "close_file" }
Run Code Online (Sandbox Code Playgroud)

现在当你点击cmd + w时,只有文件会关闭而不是整个窗口,因为你的目标是"close_file".


Moh*_*ari 5

最酷的方式是: File - > Close All Tabs