简体   繁体   中英

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.

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. 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. They should be located in the following places:

  • Linux: ~/.config/sublime-text-3/Local
  • OS X: ~/Library/Application Support/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.)

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). Make sure Sublime is closed, then delete Auto Save Session.sublime_session and Session.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.

The following hack will close everything but without losing the recent files. It works in Mac but not sure about other OS.

  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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