Home Download Buy Blog Forum Support

Keep all project files in one place?

Keep all project files in one place?

Postby giorgian on Wed Jul 18, 2012 7:45 am

Hi,

when I click on "Save Project As...", sublime proposes to save on the folder of the currently selected file, that will often be deeply nested inside the current project.
That, of course, is not where I want to keep my project files. Arguably, there are two possible ways to arrange project files:
* Keep each .sublime-project and .sublime-workspace pair in the root of their project folder;
* Keep all of these files in the same directory, maybe a dedicated one, that only contains project files.

Well, personally I go for the latter, so what I'll do is, each time I hit "Save Project As...", browse to find my preferred project directory.

Is it possible to do this automatically?


Also, if I move a project file, Sublime Text 2 will be unhappy when I try to "Switch Project In Window...". Where does Sublime Text 2 keep its list of past .sublime-project files, so that I can modify it, when needed?


Thanks.
giorgian
 
Posts: 10
Joined: Mon Dec 19, 2011 1:09 pm

Re: Keep all project files in one place?

Postby MystickPhoenix on Thu Jul 19, 2012 1:38 pm

I would second the idea to be able to keep all the project files in the same directory and the question about where sublime keeps its list of past projects for the switch project dialog.

Secondly, I tried keeping all of the project files in the same folder but it ended up getting too large and cumbersome to find the one that I wanted, so, I started explicitly saving my project files in the root of the project folder tree and since sublime takes care of the rest, it doesn't really matter where you save the project files as long as they don't move.
MystickPhoenix
 
Posts: 26
Joined: Tue Jan 24, 2012 4:36 pm

Re: Keep all project files in one place?

Postby facelessuser on Thu Jul 19, 2012 1:45 pm

I would just create a shortcut in the sidebar of your OS's window to your project folder so you have a quick link when you save as...that is what I do. I don't think ST2 really needs to manage that.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Keep all project files in one place?

Postby ToddFiske on Thu Jul 19, 2012 6:19 pm

Sublime Text stores the list of projects in \Data\Settings\Session.sublime_session, in a key at the end of the file called "workspaces", relative to your user data area. The exact location depends on your OS and whether you use the portable version or the full installer.

This is a JSON file which you can edit (with another text editor when Sublime Text is not open) to change project files paths, the order of projects, delete unused projects, etc. Make sure to keep the same syntax, particularly the commas at the end of each item except the last one. It may be possible to edit it from Sublime, but that may produce unpleasing results. =)
ToddFiske
 
Posts: 38
Joined: Wed Nov 04, 2009 10:43 pm

Re: Keep all project files in one place?

Postby quodlibet on Thu Jul 19, 2012 7:10 pm

I've been thinking about some of the same issues as the OP. At work, I run a portable Sublime out of my Dropbox. I've created a folder to keep all my projects in, but the absolute path changes from computer to computer. Does anyone know if it is possible to treat the path of the project as relative? (It's only a couple directories over ;) ) The files within the project should then be relative to the project, which will work out alright.
quodlibet
 
Posts: 531
Joined: Sat Jun 18, 2011 5:53 pm

Re: Keep all project files in one place?

Postby MystickPhoenix on Fri Jul 20, 2012 2:06 pm

quodlibet wrote:I've been thinking about some of the same issues as the OP. At work, I run a portable Sublime out of my Dropbox. I've created a folder to keep all my projects in, but the absolute path changes from computer to computer. Does anyone know if it is possible to treat the path of the project as relative? (It's only a couple directories over ;) ) The files within the project should then be relative to the project, which will work out alright.


If the files in the project could be made relative (or have a flag that turns on this setting) to the location of the project file, that would solve 99% of my personal headaches with the project structure.
MystickPhoenix
 
Posts: 26
Joined: Tue Jan 24, 2012 4:36 pm

Re: Keep all project files in one place?

Postby giorgian on Wed Jul 25, 2012 8:59 pm

ToddFiske wrote:Sublime Text stores the list of projects in \Data\Settings\Session.sublime_session, in a key at the end of the file called "workspaces", relative to your user data area. The exact location depends on your OS and whether you use the portable version or the full installer.

This is a JSON file which you can edit (with another text editor when Sublime Text is not open) to change project files paths, the order of projects, delete unused projects, etc. Make sure to keep the same syntax, particularly the commas at the end of each item except the last one. It may be possible to edit it from Sublime, but that may produce unpleasing results. =)


It worked perfectly, thank you!
giorgian
 
Posts: 10
Joined: Mon Dec 19, 2011 1:09 pm

Re: Keep all project files in one place?

Postby wolfstevent on Thu Apr 03, 2014 7:54 pm

The reply above which pointed me to the Session.sublime_session file was great, but for me (a Windows 8 user) it was not to be easily found.

You have to open file explorer, click on the View menu and select 'Hidden items' in the Show/Hide ribbon section.

Then go to your user directory, which is usually c:\users\{{username}}\

Within there go to (the hidden directory) AppData\Roaming\Sublime Text 3\Local

Within there will be all of your Sublime user files, including Session.sublime_session.

Editing this file was the first time I've seen Notepad in a looonng time.
wolfstevent
 
Posts: 2
Joined: Fri Jan 31, 2014 8:52 pm

Re: Keep all project files in one place?

Postby wolfstevent on Thu Apr 03, 2014 8:08 pm

One more thing. Backup the Session.sublime_session file before you edit. I didn't, Sublime didn't like my edit. So he blissfully went ahead and deleted my current Session file and recreated a new, pristine version.

Luckily I didn't lose any packages or preferences, but I had to rebuild my project and workspace files.

And - I found out Windows 8 File Restore doesn't backup your users\..\AppData directory. Good to know I guess.
wolfstevent
 
Posts: 2
Joined: Fri Jan 31, 2014 8:52 pm

Re: Keep all project files in one place?

Postby tito on Thu Apr 03, 2014 11:34 pm

Just because may be of your interest: If you don't rely too much in project settings and only use project files to switch folders, I'll suggest to try the package "SidebarFolders" it keeps an automated list of folders and provides handy main menu bar switching without the need to keep saving and tracking sublime-project files.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], MystickPhoenix, valrus and 31 guests