Where should you keep your Sublime Text projects?
Reader Matt S. wrote me recently because he’s been procrastinating on migrating to a new computer, partly because he isn’t sure how best to transfer his Sublime Text preferences and plugins.
This also got him wondering about where he should be keeping his Sublime project files:
I tend to keep .sublime-project/.sublime-workspace files close (in the file system) to the project they pertain to… this might be ill-advised? I don’t know, maybe better to keep them all in a single directory? ~/.sublime-projects??
Do folks keep them in the project’s source repo? I haven’t actually done that… not sure how I feel about it.
When I first started using Sublime projects, I didn’t like the idea of keeping them in the project root directory either. Wouldn’t it be better to keep all of my projects in a single folder? Then I could easily open any project from a central location.
It turned into a bit of a mess, especially because I was syncing between multiple machines. Adding folders to the projects became a pain, because I’d have to stop and figure out an appropriate relative path…
Sublime projects are really meant to be housed alongside the project’s code files. Says the official Sublime documentation:
Projects in Sublime Text 2 are made up of two files: the sublime-project file, which contains the project definition, and the sublime-workspace file, which contains user specific data, such as the open files and the modifications to each.
As a general rule, the sublime-project file would be checked into version control, while the sublime-workspace file would not.
For multi-developer projects, this makes it easier to get the code building on your machine–project files can include special build tasks. You can also include project-specific preferences, like using two spaces for indentation instead of four.
Life got easier when I quit trying to fight The Man and use projects as they were intended to be used.
For more about how to use Sublime projects, go here: