Sublime Text remember open files and folders

2019-06-26 03:34发布

问题:

All I want to do is make it so that way every time I open Sublime Text, it opens all of the files and folders that I was working on before, as opposed to me manually opening the same folders and files every time I open Sublime Text.

For example, after I close a window, the next time I open Sublime Text, I expect the same window to be opened; almost as if it was never closed.

Many thanks.

P.S. 'hot_exit' and 'remember_open_files' are both set as true under Preferences > Settings - Default.

回答1:

The things you've done should do what you're wanting, so let's re-inspect some of the basics:

With "hot_exit": true present in your settings, Sublime Text will not ask to save changes to files when exiting; it will just exit. Any open and/or changed files will open back up when Sublime Text does starts.

The "remember_open_files": true setting doesn't do anything if "hot_exit": true.
If "hot_exit": false and "remember_open_files": true, Sublime Text will prompt when closing unsaved changes, and re-open the files on startup.

So the settings you need are:

...
"hot_exit": false,
"remember_open_files": true,
...

Make sure that the settings are exactly as above, with " surrounding the setting, no quoting surrounding the value, a : separating them, and a comma at the end of the line unless it's the last line in the setting file.

If this setting isn't working for you in Preferences > Settings - Default, try it in Preferences > Settings - User.



回答2:

For anyone else looking for the answer to the question in the TITLE ie: how to set the default folder Sublime opens when 'Open Folder' is used, try this: Link to similar question on SuperUser



标签: sublimetext