Productively Distracted
Posted Tuesday December 11, 2012 around 12:55 PM

One of my favorite things about Sublime Text 2 (along with great Python and Ruby support) is the fast project switching. This is accessed via the super+ctrl+p keyboard shortcut by default. The only problem with this, is after a while the list can become polluted. The only solution provided by Sublime Text is to clear all items:

Clear Items

However if you are willing to open a couple of config files, you can clean out the specific unwanted projects and maintain quick access to all your wanted projects. How this is done was not immediately obvious to me so here are the steps.

Step 1: Locate your Sublime Text 2 Data Folder

By default these are:

  • OSX: ~/Library/Application Support/Sublime Text 2
  • WINDOWS: %APPDATA%\Sublime Text 2
  • LINUX: ~/.config/sublime-text-2

The other steps will refer to everything relational to this folder.

Step 2: Locate the .sublime_settings Files

Typically it seems there are two of these located in ./Settings.

$ find . -name "*.sublime_session"
./Settings/Auto Save Session.sublime_session
./Settings/Session.sublime_session
Download

Step 3: Remove unwanted projects

Each of these .sublime_session files is a JSON formatted file. In each file, find the workspaces.recent_workspaces array. It should look something like this:

{
    "... Rest of Session Data ...",
    "workspaces":
    {
        "recent_workspaces":
        [
            "/Users/jwebb/src/project_a/project_a.sublime-project",
            "/Users/jwebb/src/project_b/project_b.sublime-project",
            "/Users/jwebb/src/project_unwanted/project_unwanted.sublime-project",
        ]
    }
}
Download

Simply delete the offending project from each file:

{
    "... Rest of Session Data ...",
    "workspaces":
    {
        "recent_workspaces":
        [
            "/Users/jwebb/src/project_a/project_a.sublime-project",
            "/Users/jwebb/src/project_b/project_b.sublime-project"
        ]
    }
}
Download

Step 4: Save changes and Restart Sublime Text

Be sure that you still have valid JSON (trailing commas in the correct places etc) and then restart Sublime Text.

blog comments powered by Disqus