如何防止 Sublime Text 2 在启动时打开上次打开的文件/项目
当我使用“subl”打开我的项目时,我在 Lion 上并在命令行中。在我的项目文件夹中 - 它打开了我退出 Sublime 之前打开的最后一个项目。
我未选中最大首选项“退出时恢复窗口”。
我该如何防止这种行为?有这方面的偏好设置吗?
I am on Lion - and in the command line, when I open up my project using "subl ." in my project folder - it opens up the last project I had open before I quit Sublime.
I have the Max Preference "Restore windows when quitting" unchecked.
How to I prevent this behaviour? Is there a preference setting for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为您想要的行为可以通过更改
hot_exit
和remember_open_files
设置来启用。如果您查看“全局设置 - 默认”首选项,那里有一些描述这些设置的注释。如果您想更改它们,您应该在“全局设置 - 用户”文件中覆盖它们,以在更新中保留您的更改。
I think the behavior you want can be enabled by changing the
hot_exit
andremember_open_files
settings. If you check out the "Global Settings - Default" preferences, there are some comments there describing these settings.If you want to change them, you should override them in the "Global Settings - User" file to preserve your changes across updates.
如果有人想知道如何在 Sublime Text 3 中执行此操作,请将以下内容复制并粘贴到设置 - 用户中:
If anyone is wondering how to do this in sublime text 3, copy and paste the following into settings - user:
我只能通过在我的首选项中设置
"hot_exit": false
来使其工作。I could only get it to work by also setting
"hot_exit": false
in my preferences.在 Linux 上,我遇到了一个问题,我什至无法启动 Sublime Text 3,因为打开的文件太多,在我有机会更改设置之前它就会挂起。
我按照 Mike Wizowski 的建议进行操作,并编辑了
$HOME/.config/sublime-text-3/Packages/User/Preferences.sublime-settings
以包含这些设置。但是,在此之后重新启动 Sublime Text 似乎并没有解决我的问题,因为 Sublime 仍然打开了所有文件和文件夹。
我发现删除
$HOME/.config/sublime-text-3/Local/
中的 2 个“.sublime_session”文件会使 Sublime Text 忘记最近打开的文件/文件夹是什么,从而修复了我的挂起问题文本编辑器。On Linux, I had an issue where I couldn't even start Sublime Text 3 because there were too many files open and it would hang before I got a chance to change the settings.
I did what Mike Wizowski suggested and edited my
$HOME/.config/sublime-text-3/Packages/User/Preferences.sublime-settings
to include those settings.However, restarting Sublime Text after this did not seem to fix my problem because Sublime still opened all the files and folders.
I found that deleting the 2 ".sublime_session" files in
$HOME/.config/sublime-text-3/Local/
made Sublime Text forget what the recently opened files/folders were, thus fixing my hanging text editor.