问题
如题,vscode 怎么做到全部关闭页面不用弹出弹窗保存的(也就是立即关闭所有文件(未保存和已保存),无需重复的确认对话框!⚡️)。
轻松关闭 Sublime Text 中的所有(未保存和已保存的)文件,而不会被确认对话框反复打断!
解决
安装方法
通过 Package Control 安装
- 确保您已安装 Package Control
- 按
Ctrl+Shift+P
(Windows/Linux)或Cmd+Shift+P
(macOS)打开命令面板 - 键入
Package Control: Install Package
并按 Enter - 从列表中搜索
Close All without Confirmation
并选择安装
手动安装
- 下载或克隆此存储库:github.com/ddbln/Close…
- 打开 Sublime Text,点击
Preferences > Browse Packages...
打开包目录 - 将整个
Close All without Confirmation
文件夹复制到 packages 目录中
使用方法
通过命令面板使用
- 按
Shift+Command+P
(Mac)或Shift+Ctrl+P
(Windows/Linux)打开命令面板 - 键入"Close All without Confirmation"(支持自动补全)
- 按 Enter 执行命令
执行后将显示快速面板,提供两个选项:
- "Close all files in all windows"(关闭所有窗口中的所有文件)
- "Close all files in active window only"(仅关闭活动窗口中的所有文件)
使用方向键选择选项后按 Enter 确认。
自定义快捷键设置
默认情况下插件不添加快捷键,可按以下步骤设置:
- 进入
Preferences > Package Settings > Close all without Confirmation > Key Bindings - Default
查看默认键绑定 - 复制适合您平台的键绑定代码
- 进入
Preferences > Package Settings > Close all without Confirmation > Key Bindings - User
- 粘贴键绑定代码并取消注释(删除行首的"//")
- 保存文件
推荐快捷键设置
macOS 平台建议:
[
{
"keys": ["super+alt+shift+w"],
"command": "close_all_without_confirm"
}
]
Windows/Linux 平台建议:
[
{
"keys": ["ctrl+alt+shift+w"],
"command": "close_all_without_confirm"
}
]
自定义配置
禁用确认提示
可通过修改用户设置实现无提示关闭所有文件:
- 进入
Preferences > Package Settings > Close All without Confirmation > Settings
- 添加以下配置:
{
"ask_before_closing": false,
"close_only_active_window": false
}
ask_before_closing: false
- 禁用确认提示close_only_active_window: false
- 关闭所有窗口中的文件(设为 true 则仅关闭活动窗口中的文件)