editortextmatetextmate2

How to reveal current document in File browser in TM2 like the Project drawer in TM1?


Ctrl-Cmd-R in TM1 used to reveal the location of the current file in the project drawer. This was a very useful feature in textmate.

TM2 has the same shortcut and call its 'Current document' and works very similarly, but it also changes the current directory in the File browser (the new Project drawer equivalent in TM2 I think). This is not very useful as I would like to keep my project root open in the File browser.

Also if I tried to navigate back to the project root by using Ctrl-Tab (Focus on File drawer), and Cmd + Up Arrow (Move to parent directory), then file drawer goes back to the original state and does not have the required file "revealed" in the File Browser.

Has anyone managed to get around this? I would like a behavior similar to TM1.(also found in most IDEs/editors)


Solution

  • You have to create a .tm_properties file in your project root and add this line:

    projectDirectory = "$CWD"
    

    That way TM2 knows to perform all file search related queries from the path, so when using cmd+T you'll not only see matches from the current root in the finder/project drawer.

    If you want to navigate the project using the finder/project drawer use the same keys as in Finder.