Sublime Forum

Where should the .sublime-project file be stored?

#1

Hi,

I am a bit unsure on how Sublime Projects were intended to function. Should all projects be stored in some kind of “Project” folder or should the file be stored at the root of each Project itself?

So, should it look like this?

  • Sublime Projects
  • some-project.sublime-project
  • some-other-one.sublime-project

or like this:

  • Projects
  • Project A
    • main.cpp
    • project-a.sublime-project
  • Project B
    • index.html
    • project-b.sublime-project?

I am asking, because when I want to save the project file, it opens the explorer on another location than the other project files and how the "working_dir": "${project_path:${folder}}" works out with that.

Thanks,
Kim

0 Likes

#2

Found it!

“As a general rule, the sublime-project file would be checked into version control, while the sublime-workspace file would not.”

0 Likes

#3

I am not sure why you would want to include your text editor files in your version control system with your code, especially if you’re sharing that code.

I normally keep all Sublime project files a level above my git repos e.g. a “Projects” directory.

That way I know they are all in a single directory for easy back-ups/copies/moves. I can put them into a separate git repo if I need to sync across machines.

0 Likes

#4

One reason would be that the data in the project file might contain project specific settings or other project specific setup. For example if you’re sharing code with your team and it’s required that tabs be four spaces in this project, or if you know that certain directories need to be excluded from the sidebar, etc.

Certainly nothing that you couldn’t just restore yourself when you check out the code in a new environment, but it can be a time saver.

0 Likes

#5

That’s true, but assuming not everyone is using the same editor, including a Sublime specific file seems odd. You could save vim modelines in all files, but if people don’t use Vim it’s just messy.

Teams often work to a coding standard to ensure they manage their personal editor settings how they need to.
People should track these types of files separately to share with others if requested.

0 Likes

#6

That’s true. I only do this for projects that I work on on my own, for what it’s worth.

On the other hand, every time I unarchive a project from before I started using Sublime I need to redact a (now redundant) .idea directory from it, so I totally get where you’re coming from.

0 Likes

#7

I usually only submit the project file to version control if I know that everyone or at least a majority is using sublime text. I also submit it for my own packages since it is likely that people working on it are also using ST for that.

That considered, I never submit trivial projects with only the current folder or similar.

For cross-editor coding style preferences there is editorconfig, but you need a plugin for most (all?) editors to support it.

1 Like