LLM Comparison: Managing Sublime Text Projects
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.
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:
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.
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.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.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
:- Close Sublime Text.
- Find the
Session.sublime_session
file (location varies by OS - see below) - Open this file with a different editor (not Sublime Text)
- Carefully locate and delete the entries referencing deleted projects.
- 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
- Sublime Text 2:
- 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
- Create a Sublime Project:
- Project > Save Project As…
- Navigate to your desired project folder
- Create a
.sublime-project
file (e.g.,myproject.sublime-project
)
- 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.
- Open the
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:
Open Sublime Text.
Go to the “Project” menu in the top menu bar.
Select “Edit Project” from the dropdown menu. This will open the project configuration file for the current project.
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.
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.To remove a project from the list, simply delete the corresponding entry from the “folders” section.
After making the desired changes, save the project configuration file.
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
Gemini Advanced
Claude 3 Opus
This is the same irrelevant information as GPT item 2.