Posts RSS Comments RSS 32 Posts and 1,017 Comments till now

TextMate Tip – Project Navigation

Today I’ll talk about getting around in your projects. First up: moving between tabs in the project window.

To switch to the tab to either side of the current one you can use ⌥⌘← and ⌥⌘→, and to move directly to a tab simply press and a number from 1-9. You can use the mouse to reposition tabs to move related files next to each other, to make switching easier.

The star of the show today is:

Go to file

Display this window by using Navigation → Go to File…, or by pressing ⌘T.

Much like the bundle item search window, here you enter a query which matches against the files in the project, and you can press to open that file. It also remembers query/file combinations, so that you can easily get to files you use often – and as an added bonus, it shows the files in the order they were last used, which means you can easily switch to the last file/tab you were in by pressing ⌘T and then .

Note: Pressing the disclosure arrow at the bottom left of the window will allow you to set up additional filtering by extension for the files displayed in the list.

Another very useful function is the Navigation → Go to Header/Source, bound to ⌥⌘↑ – this moves to the next file in the project with the same base name (without the extension) as the current file. For example, when working on a controller file example.php and a template file example.tpl, (or an implementation file example.c and a header file example.h) then ⌥⌘↑ will switch between them.

One last little tip: you can press ⌃⌘R to select (Reveal) the current file in the project drawer. One nice use for this is when we want to do an SVN commit on the current file only, so we can just do ⌃⌘R ⌃⇧A. Also, you can use ⌃⇥ to switch the focus to the project drawer, this is useful when doing a commit of the whole project, i.e. ⌃⇥ ⌥↑ ⌃⇧A

As always it’s worth checking through the bundle you’re using for useful commands – for example, ⇧⌘D is commonly used to open included files (e.g. in PHP, Ruby and Xcode), ⌥⌘↓ is used to open the current project in Xcode, and the Ruby on Rails bundle has many useful shortcuts for getting around your application’s files.

5 Responses to “TextMate Tip – Project Navigation”

  1. on 07 Dec 2007 at 1:32 amchristoffer winterkvist

    awesome tip

  2. [...] Project Navigation Tips [...]

  3. on 08 Dec 2007 at 10:40 pmYi Qiang

    Great TextMate tips, keep them coming!

  4. on 18 Mar 2008 at 7:48 pmAdam Khan

    Ditto Yi Qiang’s comment. Thanks for these.

  5. on 18 Feb 2009 at 11:55 pmchris

    Many thanks …. I just couldn’t remember that reveal command.

Fork me on GitHub