PETR KOUT - ENGINEERING AND PHYSICS

MY PERSONAL SITE AND BLOG ABOUT SOFTWARE AND HARDWARE ENGINEERING, AND PHYSICS

Remove Projects From Sublime Text Switch Project Window

By Petr Kout, October 16, 2014


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, which opens the Switch Project window and lets me easily switch to another project. However, if I delete a project, 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.

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 on Windows and Mac. Try looking here:

Mac: ~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session
Windows: C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session)

Find the section named Workspaces. In my case, it contains three projects:

"workspaces":
{
    "recent_workspaces":
    [
        "/home/petr/projects/projectA/projectA.sublime-workspace",
        "/home/petr/projects/projectB/projectB.sublime-workspace",
        "/home/petr/projects/projectC/projectC.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",
        "/home/petr/projects/projectB/projectB.sublime-workspace",
    ]
}

Once done, reopen Sublime Text, go to your Switch Project window and you’ll see two projects there instead of three.