Dear all,
I have a strong feeling that this has come up before, but I can't seem to find it in the mailing list archives. Can I ask why the TM_PROJECT_DIRECTORY isn't set to the top-level directory by default? (I'd like to use it to set my windowTitle to just the last element in that path, as in TM1, without needing a .tm_properties file in every project. So if that's possible by another route, I'd be glad to hear about that too...)
Thanks, Jon
On Sep 12, 2012, at 12:48 PM, Jon Clayden jon.clayden@gmail.com wrote:
[…] why the TM_PROJECT_DIRECTORY isn't set to the top-level directory by default?
The project directory never changes for a project, the file browser can change a lot, be hidden, show non-folders (e.g. SCM status). So while it would make sense to allow setting the project directory from the file browser, it doesn’t make sense to treat the file browser as always showing/knowing the project directory (also, what would Go → Project Folder do, if the file browser defined the project folder? ;) ).
[…] without needing a .tm_properties file in every project.
Storing a .tm_properties in “every project” is really no different than how 1.x had you save a tmproj for every project.
I assume you’re aware that you can use $CWD, so you can re-use the .tm_properties file for each project, if windowTitle and projectDirectory is all you want to set — Elia’s bundle allows saving out a .tm_properties file on ⌃⌘S: https://github.com/elia/avian-missing.tmbundle/
If all your projects are e.g. in /Users/me/Projects then it might also be possible to create:
# /Users/me/Projects/.tm_properties projectDirectory = "${TM_FILEPATH/(/Users/me/Projects/[^/]+).*/$1/}"
Dear Allan,
Many thanks for the quick reply.
[…] why the TM_PROJECT_DIRECTORY isn't set to the top-level directory by default?
The project directory never changes for a project, the file browser can change a lot, be hidden, show non-folders (e.g. SCM status). So while it would make sense to allow setting the project directory from the file browser, it doesn’t make sense to treat the file browser as always showing/knowing the project directory (also, what would Go → Project Folder do, if the file browser defined the project folder? ;) ).
Yes, OK - that makes sense. But then might there be a case for introducing a new TM_* variable representing the current top-level directory in the file browser, if there is one?
If all your projects are e.g. in /Users/me/Projects then it might also be possible to create:
# /Users/me/Projects/.tm_properties projectDirectory = "${TM_FILEPATH/(\/Users\/me\/Projects\/[^\/]+).*/$1/}"
In the meantime I will use this. Many thanks for the suggestion.
All the best, Jon
On Sep 12, 2012, at 4:32 PM, Jon Clayden jon.clayden@gmail.com wrote:
[…] might there be a case for introducing a new TM_* variable representing the current top-level directory in the file browser, if there is one?
What would the point of that be?