Remove Projects From Sublime Text Switch Project Window

I am a big fan of Sublime Text. To switch between existing projects, I like to use the CTRL+ALT+P shortcut in my Kubuntu (CTRL+CMD+P on a Mac), which opens the Switch Project window and lets me easily switch to another project. However, if I delete a project from the file system, it doesn’t get removed from this list. Fortunately, there is a workaround. Here is how you can remove your deleted or moved project from the Switch Project window.

sublime-text-switch-project

First of all, close Sublime Text. If you keep it open while continuing, your work will be for naught.

vim ~/.config/sublime-text-3/Local/Session.sublime_session

The paths are different for Windows and macOS. Use these paths for your operating system:

macOS: ~/Library/Application\ Support/Sublime\ Text\ 3/Local/Session.sublime_session
Windows: C:\Users\[Username]\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session)

Find the section named workspaces. In my case, it contains two projects:

"workspaces":
{
    "recent_workspaces":
    [
        "/home/petr/projects/projectA/projectA.sublime-workspace",
        "/home/petr/projects/projectB/projectB.sublime-workspace"
    ]
}

Let’s assume I deleted the folder containing project ProjectC, so I want to remove it from the Switch Project window. All I need to do is to simply remove the corresponding line in the file, save the file, and exit.

Now the relevant section should look like this:

"workspaces":
{
    "recent_workspaces":
    [
        "/home/petr/projects/projectA/projectA.sublime-workspace"
    ]
}

And that’s it! After restarting Sublime Text 3, its Switch Project window contains only one project.

sublime-text-switch-project
comments powered by Disqus