关闭 Sublime Text 3 应用程序时保留未保存的文件

pho*_*van 5 notepad++ sublime-text-3

我在 Windows 上使用 Notepad++,现在我使用 Mac。所以,我不能再使用 Notepad++,我切换到 Sublime Text 3。

在 Notepad++ 中,我使用了一个功能来处理未保存的文件。当我关闭应用程序时,它不需要保存文件,当我再次打开 Notepad++ 时,未保存的文件会重新打开。

使用 Sublime Text 3 中的默认配置,我看不到该功能。Sublime Text 3 支持吗?如果存在,如何配置?

MJH*_*MJH 6

我相信您正在寻找hot_exit环境。


由于我在 Windows 10 Pro 中运行 Sublime Text 3(Build 3126),我不能确定这是否对你来说完全一样,但 Windows 中的步骤如下:

  1. 点击Preferences -> Settings

  2. 在打开的新双窗格窗口中,右侧的选项卡标记为Preferences.sublime-settings-User。如果该文件不包含任何文本,只需粘贴以下内容,保存文件并关闭它:

    {
        "hot_exit": true
    }
    
    Run Code Online (Sandbox Code Playgroud)

如果该文件已包含文本,请将现有设置的值hot_exitfalseto更改为true,或添加"hot_exit": true上面的行(不带花括号)。使用逗号将该行与其前后的行分隔开。有关在 Sublime Text 3 中使用设置的更多信息,请参阅文档


hot_exit以下是来自文件的设置 的完整描述Preferences.sublime-settings-Default(不应修改,这就是上述Preferences.sublime-settings-User文件存在的原因):

// Exiting the application with hot_exit enabled will cause it to close
// immediately without prompting. Unsaved modifications and open files will
// be preserved and restored when next starting.
//
// Closing a window with an associated project will also close the window
// without prompting, preserving unsaved changes in the workspace file
// alongside the project.
Run Code Online (Sandbox Code Playgroud)