You can deleate files when you right-click on a file and choose Delete in the context menu or from a command palette to delete currently opened file. Just to be clear, you can't remove a file from a project, you can only remove a folder.
Projects in Sublime Text are made up of two files: the . sublime-project file, which contains the project definition, and the . sublime-workspace file, which contains user specific data, such as the open files and the modifications to each.
It would be nice if Sublime Text removed projects you've deleted from the recent projects list. Unfortunately, it does not and the list can become littered with projects that no longer exist.
Until Sublime Text offers this feature there are a couple of manual ways you can remove projects.
If you're just looking for the fastest way to clean up your list this option is for you.
Please be aware that this will clear out all projects in the recent list. This includes ones you have not deleted.
In the Sublime Text menu goto:
Project > Open Recent > Clear Items
Locate the Session.sublime_session
file using the paths below and open it with another code editor. * DO NOT open it with Sublime Text as any changes you make will be overwritten. *
Paths to Session.sublime_session
file listed by OS and ST version:
Windows x64:
Sublime Text 2
C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session
Sublime Text 3
C:\Program Files\Sublime Text 3\Data\Local\Session.sublime_session
Mac OSX:
Sublime Text 2
~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session
Sublime Text 3
~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session
Linux (Ubuntu):
Sublime Text 2
~/.config/sublime-text-2/Settings/Session.sublime_session
Sublime Text 3
~/.config/sublime-text-3/Local/Session.sublime_session
What to expect to see:
You should see something like the following at the bottom of this file:
Remove the unwanted project(s) from this file
What the file would look like after deleting project3:
Save and re-launch Sublime Text 2/3
You can check out the Sublime Text plugin Project Manager.
You can check out: clean-sublime-text-project-history
Just to clarify something in Valjas' solution above.
When he says: "Go to Sublime Preferences folder..." he means: "Go to the USER folder", not the Program folder.
Although obvious for many, it may not be for others:
You HAVE to edit the Session.sublime_session
file with a different text editor, and Sublime Text itself has to be closed.
DO NOT use Sublime Text itself, or leave the program running while making the changes.
If you do it'll overwrite your changes when closing the app.
• WINDOWS x64:
C:\Users\[Username]\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session
• Linux (Ubuntu):
~/.config/sublime-text-3/Local/Session.sublime_session
• Mac OSX/Sierra:
~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session
• Portable Installation (It might work for ST2 as well but I haven't tested):
/folder-where-you-have-ST3-installed/Data/Local/Session.sublime_session
--
• WINDOWS x64:
C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session
• Mac OSX:
~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session"
then find the section "recent_workspaces"
.
• Linux (Ubuntu):
~/.config/sublime-text-2/Settings/Session.sublime_session
Easy, look for the "recent_workspaces"
section, it's usually at the bottom of the file.
It should look similar to this:
ST3 Linux (Ubuntu) / Build 3047 path added from @ezrepotein4's comment.
ST2 Linux (Ubuntu) path added from @0x4a6f4672's comment.
Windows x64 and Mac paths taken from this post.
Sublime Text 2: To clean up sublime file history, project history, autocomplete history and find/replace history do the following
When you close sublime again and look up the settings directory, it will still have a Session.sublime-session file because sublime re-created it but its size shall be smaller than the one you had earlier cos it doesn't contain any junk data from previous projects history etc.
I hope this shall improve startup times for sublime text 2. You may choose to take a backup of Session.sublime-session to a different folder incase you want to remember the project paths etc. and then copy paste the once you need using a file comparison software. Just remember to close sublime whenever you deal with Session.sublime-session i.e. if you need to make any changes in that file, you'd be making them in some other text editor like notepad++ etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With