Reputation: 1529
I use Sublime Text 2 for editing a lot of temporary files. I end up with lots of tabs open.
I want to close all open tabs without saving and without the "Do you want to save the changes you made to new file?" prompt showing and having to click on "Don't Save" for each tab.
Upvotes: 49
Views: 35555
Reputation: 1
I had the same problem and wrote a plugin package for sublime to close all files without confirmation. It works via command palette and you can add key bindings too:
https://packagecontrol.io/packages/Close%20All%20without%20Confirmation
Upvotes: 0
Reputation: 772
Below worked for me in Mac OS
rm -rf ~/Library/Application\ Support/Sublime\ Text\ 3/Local/
Upvotes: 1
Reputation: 137
Search for Session.sublime_session
file in your /Library/Application\ Support/Sublime\ Text\ 3/Local/
folder.
Delete the file via the finder app.
Else execute
rm /Library/Application\ Support/Sublime\ Text\ 3/Local/
Upvotes: 3
Reputation: 61
You can remove the session data. In Windows, navigate to /your/sublime/install/Data/Local/
and remove any .sublime_session
files. Kill sublime if it's open: press WindowsBtn+R and enter taskkill /F /IM sublime_text.exe
Next time you open up Sublime, a single empty window will show.
Process is probably similar for other OS too.
Upvotes: 6
Reputation: 33389
If you're working in an environment with version control, it might actually be easier to leverage that to get the same effect:
In your VCS, stash your changes, (or otherwise ensure that you have a clean working environment)
In Sublime, hit Save All, then Close All.
In your VCS, clear away all the changes you just made. (git reset --hard
, in git)
There are some caveats (if you modified files that aren't in your VCS this won't work for them); but I found it a lot easier than messing with SublimeText settings.
Upvotes: 4
Reputation: 3823
TabsExtra gives you several additional tab closing options via the tab menu:
Upvotes: 77
Reputation: 2999
My way is revert all files after to close all files:
View/Show Console and enter command:
len([v.run_command("revert") for v in window.views()])
Or Save after Close all files:
len([v.run_command("save") for v in window.views()])
Then go to File/Close All Files
I tested on Mac OS and Sublime Text 2. You can try other version and OS.
Hope help you to close all files.
Upvotes: 34
Reputation: 1192
Just found the solution !!! Better to share it on StackOverflow :
1) Go to preferences, Setting-Default
2) Change the value of the 2 parameters "hot_exit" and "remember_open_files" to false
3) Kill Sublime Text brutally with the Task Manager
4) Launch Sublime Text
Cheers !
Upvotes: 55