[TxMt] Re: Default TM_PROJECT_DIRECTORY

Allan Odgaard mailinglist at textmate.org
Wed Sep 12 11:06:15 UTC 2012


On Sep 12, 2012, at 12:48 PM, Jon Clayden <jon.clayden at 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/}"



More information about the textmate mailing list