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 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:
Display this window by using Navigation → Go to File…, or by pressing
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
⌥⌘↑ 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
⌃⇧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.
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”