Knowledge is the Only Good
  • About

On this page

  • Introduction
  • Related posts
  • Question
  • Responses
  • Comments

LLM Comparison: Managing Sublime Text Projects

notes
llm
Gemini, GPT, and Claude answer questions about Sublime Text
Author

Stephen J. Mildenhall

Published

2024-03-20

Introduction

This post is another comparison of LLMs. It asks a question about Projects in Sublime Text (ST). ST is a wonderful editor that I started using in 2017—when I finally made the switch from Emacs. ST can gather folders, open files, and other settings you are using into a Project. Projects are very handy for working on different, well, projects.

The ST command Switch Project allows you to switch quickly between projects. My Switch Project dialog had become cluttered with old projects, and I wanted to clean it out. I asked GPT4, Gemini Advanced, and Claude Opus 3. Here are their responses and comments. Gemini was the clear winner in this case, with a workable solution and two useful pieces of information.

Related posts

  1. Python programming problem involving classes

Question

in sublime text how do i edit the list of projects that appear when i do ctrl+alt+p quick switch project?

Responses

GPT

To edit the list of projects that appear in the “Quick Switch Project” (Ctrl + Alt + P) menu in Sublime Text, you need to manage your project files and sessions:

  1. Remove Unwanted Projects: To remove a project from the list, you need to open the project and then close it using “Project -> Close Project”. This action will remove the project from the quick switch list.

  2. Edit Project Files: If you want to modify the details of a project, you can open the .sublime-project file in Sublime Text and edit it directly. These files are usually located in the same directory as the project.

  3. Session File: Sublime Text stores session information, including the list of recent projects, in a session file. For advanced users, you can locate this file (usually Session.sublime_session in the Sublime Text config directory) and edit it manually to remove entries. Be cautious with this approach to avoid corrupting the session file.

  4. Reindexing: If you’re facing issues with the project list not updating correctly, you might want to restart Sublime Text to ensure it reindexes the project list.

Remember to back up your project and session files before making any manual changes to avoid data loss.

Gemini Advanced

Here’s how you can edit the list of projects in Sublime Text’s Quick Switch Project (Ctrl+Alt+P):

1. Removing Non-Existent Projects

  • Project > Open Recent > Clear Items: Clears the entire list of recent projects, including those that no longer exist.
  • Project > Open Recent > Remove Deleted: A more targeted approach that helps remove project entries pointing to deleted locations.
  • Manually Editing Session.sublime_session:
    1. Close Sublime Text.
    2. Find the Session.sublime_session file (location varies by OS - see below)
    3. Open this file with a different editor (not Sublime Text)
    4. Carefully locate and delete the entries referencing deleted projects.
    5. Save the file and relaunch Sublime Text.

Locations of Session.sublime_session

  • Windows:
    • 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: ~/Library/Application Support/Sublime Text [2 or 3]/Local/Session.sublime_session
  • Linux: ~/.config/sublime-text-[2 or 3]/Local/Session.sublime_session

2. Manually Adding Projects

  1. Create a Sublime Project:
    • Project > Save Project As…
    • Navigate to your desired project folder
    • Create a .sublime-project file (e.g., myproject.sublime-project)
  2. Edit the .sublime-project file:
    • Open the .sublime-project file in Sublime Text. Its basic structure is:
    {
        "folders":
        [
            {
                "path": "."
            }
        ]
    }
    • Make sure the path attribute points to the correct folder of your project.

Important Notes:

  • BACKUP: Always create a backup of your Session.sublime_session file before manual editing.
  • Syntax: Be careful when editing JSON files, as incorrect syntax can cause errors.

Let me know if you’d like more detailed instructions on any specific part of this process!

Claude 3 Opus

In Sublime Text, the list of projects that appear when you use the “Quick Switch Project” feature (Ctrl+Alt+P) is determined by the projects you have opened or saved in the past. To edit this list, you can follow these steps:

  1. Open Sublime Text.

  2. Go to the “Project” menu in the top menu bar.

  3. Select “Edit Project” from the dropdown menu. This will open the project configuration file for the current project.

  4. In the project configuration file, you will see a JSON-like structure that defines the project settings. Look for the “folders” section, which lists the directories included in the project.

  5. To add a new project to the list, you can create a new entry in the “folders” section with the following format:

    {
        "path": "/path/to/your/project"
    }

    Replace /path/to/your/project with the actual path to your project directory.

  6. To remove a project from the list, simply delete the corresponding entry from the “folders” section.

  7. After making the desired changes, save the project configuration file.

  8. Restart Sublime Text for the changes to take effect.

Now, when you use the “Quick Switch Project” feature (Ctrl+Alt+P), the updated list of projects will be displayed, reflecting the changes you made in the project configuration file.

Alternatively, you can also manage your projects using the “Project” menu:

  • To add a new project, go to “Project” > “Add Folder to Project” and select the desired project directory.
  • To remove a project, go to “Project” > “Remove all Folders from Project”.
  • To save a project, go to “Project” > “Save Project As” and specify a name and location for the project file.

By using these methods, you can customize the list of projects that appear in the “Quick Switch Project” feature according to your needs.

Comments

GPT

  1. I did not find this to be the case. I closed projects but they still appeared in the list.
  2. This is true but irrelevant.
  3. Editing the session file is not recommended and the file is hard to find.
  4. On principle, I hate the “just restart” recommendation.

Gemini Advanced

  1. The first two recommendations are helpful, and the first solved my problem and allowed me to start afresh. I would have preferred more nuanced control but this got the job done. The second is good to know. This is relevant and helpful information. The third is the same as 3 above, but it helpful to be told where the file lives!
  2. True but irrelevant.

Claude 3 Opus

This is the same irrelevant information as GPT item 2.

Stephen J. Mildenhall. License: CC BY-SA 2.0.

 

Website made with Quarto