Sublime Forum

Auto load projects when launching sublime from the command line


I am wondering if there is a way to automatically load a Sublime project from a folder from the command line without having to specify the actual project file to be loaded? For example, suppose I have a project file named “myproject.sublime-project” in the current working folder. In order to open that project I have to run “subl myproject.sublime-project”. This requires a lot of unnecessary typing, and you can’t even use tab-completion for this because every project also seems to have an associated “workspace” file which has a very similarly named file, so typing “subl myp” and pressing tab results in multiple potential matches.

In the interest of streamlining the interactions for people who work on the shell a lot, I would like to see a shorthand feature added to the app which automatically loads a project file if one exists in the current working folder, or alternatively to load a project from a path which is specified on the console. In this way users could just do “subl .” in the same folder as their project file and the project would be opened.

I’m not sure if Sublime supports having multiple projects in a single folder, but if it does I’d suggest just prompting the user to select one of the projects in a pop-up dialog that appears when opening the editor in that case.



You can indeed have as many sublime-project files in your project folder as you want, including none at all if you decide you want to store all of them in a different location, like ~/myProjects so that they’re all out of the way, etc.

Probably a bit of a pain on Windows, but on Linux/MacOS a shell script wrapper on subl wouldn’t be too hard to write that does this.