How to prevent Sublime Text 2 from opening that last open file / project when starting up

不羁岁月 提交于 2019-12-03 02:44:25

问题


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?


回答1:


I think the behavior you want can be enabled by changing the hot_exit and remember_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.




回答2:


If anyone is wondering how to do this in sublime text 3, copy and paste the following into settings - user:

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



回答3:


I could only get it to work by also setting "hot_exit": false in my preferences.




回答4:


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.



来源:https://stackoverflow.com/questions/7890102/how-to-prevent-sublime-text-2-from-opening-that-last-open-file-project-when-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!