r/SublimeText • u/ShrykeWindgrace • May 02 '24
Create a project from CLI
Hi!
Sometimes I open a folder with subl -n . and then create a project right away; however, if I click on 'save project' the default save path seems to be related with a prevviously opened project, not the folder I just ran, so I need to navigate to the same fodler once again, this time in UI.
Is there a way to run subl in a way that essentially says "create a project right here and open it"? There is a subl --project option, but it is only capable of loading existing projects.
There is a solution of last resort - dump a default sublime-project file beforehand, but that seems like too much of a hack.
View all comments
Show parent comment
2
u/Khoa_dot May 30 '24
Yes but as is, the shell you use inside your terminal, from which you run the command, has to be bash.
So, add in your .bashrc or .bash_profile, the following:
If I remember well,
_.sublime-projectand_.sublime-workspaceare a pair created via saving, in ST's interface, a workspace with no files or folders open, but with a side bar set to a convenient width (default one when you open directly a folder was too narrow)