57

I recently upgraded to Textmate 2 and now my dotfiles are not showing up in the file browser. Obviously, this is important when working with stuff like .htaccess files.

Is there a way to enable this feature?

Noldorin
  • 144,213
  • 56
  • 264
  • 302

3 Answers3

95

Quick solution

Move the focus to the file browser (⌥⌘⇥) and show invisibles (⌥⌘i)(key names: option/alt+command/windows+i/eye). All invisible files will appear in the file browser. Press ⌥⌘i again to hide them.

Permanent solution

If you want to always show some dotfiles (for instance .htaccess), you can either add them in Preferences > Projects > Include files matching… or add the list of files you want to show to the include array in one of:

  • ~/Library/Application Support/TextMate/Global.tmProperties (same as using Preferences)
  • ~/.tm_properties (global)
  • .tm_properties (inside a specific directory/project)

You can add all dotfiles (.*) but I don't recommend it since it can be a lot of clutter. That said, you can also exclude files with the exclude array.

Mohamed El-Nakeep
  • 6,580
  • 4
  • 35
  • 39
Simon
  • 31,675
  • 9
  • 80
  • 92
  • Your "Quick solution" is to hide/show invisible characters (tabs, spaces, etc.), not to hide/show hidden files... – Stéphane Péchard Jan 28 '14 at 14:22
  • 5
    @StéphanePéchard Yes, it is for hidden files _when the focus is on the file browser_! – Simon Jan 28 '14 at 14:31
  • 1
    does not work for me, still toggle invisible characters... (TextMate version 2.0-alpha.9503) – Stéphane Péchard Jan 28 '14 at 15:07
  • 7
    @StéphanePéchard I initially had trouble getting this to work too, but realized that to make the file browser actually be in focus, you have to click twice on any file in the browser (but not double-click), so that it's selector turns blue instead of remaining gray. – Claw Apr 24 '14 at 19:41
  • 5
    Had a bit or trouble figuring what key strokes it took (I'm not a native mac user). Here it is without the symbols: (option) + (command) + (i). – Shadoath Jul 30 '14 at 18:02
  • Note: ⇥ equals "tab". So, ⌥⌘⇥ is "alt/option + command + tab". – Seph Mar 17 '15 at 21:53
22

You can modify the behavior of the file browser via the config file ~/.tm_properties

To list all dotfiles and directories, you can set:

include = "{$include,.*}"

If you want to exclude some of those, for example the .git directory, modify the exclude variable:

exclude = "{$exclude,.git}" 

There are many more options, check the Textmate site as an entry point for whats possible: http://blog.macromates.com/2011/git-style-configuration/

kwood
  • 9,854
  • 2
  • 28
  • 32
14

You can do this in the preferences of Textmate 2.

Navigate to: Textmate -> Preferences -> Projects. You should see two fields, one for including files, and one for excluding. I replaced the value of "Include files matching" with {*,.*} so it includes all normal and hidden files. I then just add the hidden files I want to exclude to the "Exclude files matching" field, such as .git and .DS_Store.

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
TomWardrop
  • 557
  • 5
  • 12