简体   繁体   English

Sublime-Text 强制不加载以前的文件

[英]Sublime-Text Force to not load previous files

I've accidentally opened tons of files.我不小心打开了大量文件。 The nice feature that Sublime loads all files which were open in the previous session becomes a problem at this moment. Sublime 加载上一个会话中打开的所有文件的好功能此时成为一个问题。

So i've find a setting to disable this feature, so that i start with a clean session.所以我找到了禁用此功能的设置,以便我从一个干净的会话开始。

Prefrences/Settings/User首选项/设置/用户

"hot_exit": false,
"remember_open_files": false,

However this doesn't help.然而,这没有帮助。 When i open SB3, still it loads all the files which were open before.当我打开 SB3 时,它仍然加载之前打开的所有文件。 Maybe the config changes are not picked because i am killing the app instead of closing?也许没有选择配置更改,因为我正在杀死应用程序而不是关闭?

So the easiest way around this will be to delete your .sublime_session files.因此,解决此问题的最简单方法是删除您的.sublime_session文件。 They should be located in the following places:它们应位于以下位置:

  • Linux: ~/.config/sublime-text-3/Local Linux: ~/.config/sublime-text-3/Local
  • OS X: ~/Library/Application Support/Sublime Text 3/Local OS X: ~/Library/Application Support/Sublime Text 3/Local
  • Windows: C:\\Users\\username\\AppData\\Roaming\\Sublime Text 3\\Local Windows: C:\\Users\\username\\AppData\\Roaming\\Sublime Text 3\\Local

(I can confirm the first two, but I don't have access to a Windows box at the moment to confirm the last location. I'm reasonably sure that's its location, through.) (我可以确认前两个,但我目前无法访问 Windows 框来确认最后一个位置。我有理由确定这是它的位置,通过。)

Open the Local folder either via the command line or through your operating system's file manager (I'd recommend the command line for OS X and Linux as ~/Library and ~/.config are hidden by default).通过命令行或操作系统的文件管理器打开Local文件夹(我建议 OS X 和 Linux 的命令行,因为默认情况下~/Library~/.config是隐藏的)。 Make sure Sublime is closed, then delete Auto Save Session.sublime_session and Session.sublime_session .确保 Sublime 已关闭,然后删除Auto Save Session.sublime_sessionSession.sublime_session This will not only close all the windows and tabs you have open, but it will also remove the entries in the File -> Open Recent and Project -> Open Recent menus.这不仅会关闭您打开的所有窗口和选项卡,还会删除File -> Open RecentProject -> Open Recent菜单中的条目。

The following hack will close everything but without losing the recent files.以下 hack 将关闭所有内容,但不会丢失最近的文件。 It works in Mac but not sure about other OS.它适用于 Mac,但不确定其他操作系统。

  1. Right click and select Quit.右键单击并选择退出。 Then the annoying "Do you want to save..." dialog box will appear.然后会出现烦人的“您要保存...”对话框。
  2. Then use Force Quit and close the sublime.然后使用强制退出并关闭崇高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM