Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

backreferences textmate

Use dollar sign and ordinal number to specify back references.
Don't escape group delimiters (regular round braces)

(/something)_else\n


$1_other

Cool TextMate Stuff


* Cmd-E to copy text directly into the Find buffer.
* Cmd-Return / Cmd-Shift-Return to open a new line (or append a semicolon to the current line and open a new line).
* Cmd-Opt-. to close the current XHTML tag.
* Automatically typing of closing quotes, braces, etc (sometimes annoying, usually helpful).
* Opening a folder instead of a single file.
* Cmd-T (Go to File) and Cmd-Shift-T (Go to Symbol). Nicely intelligent live searching. Go to File looks for files in the current project (or current folder, if that's what you opened), and preselects the previous file you jumped to - it works like a Cmd-Tab, so to quickly flip between two files in the project, just invoke Cmd-T & hit enter.
* Esc for symbol completion.
* Cmd-H to pull up API documentation.
* Cmd-/ to comment out lines or blocks of lines.

Change OS X font smoothing in one application

E.g, Light font smoothing style in Textmate.

$ defaults write com.macromates.textmate AppleFontSmoothing -int 1

Faster find in project

http://pastie.caboo.se/81736

Patch / Diff Hunk Matching Regexp

This is tested in TextMate and I use it to select successive hunks of a patch file in diff -u format.

(?m)^@@.*?^(?=@@)

opening in a textmate project all files that match a pattern

This will pass all matched filenames to textmate, generating a project with all files flatly in the drawer (no dirs)

egrep -lr pattern * | grep -v .svn | xargs mate

Check out all TextMate Bundles with SVN

svn --username anon --password anon co http://macromates.com/svn/Bundles/trunk/Bundles /Users/ned/Library/Application\ Support/TextMate/Bundles

Stop TextMate from writing metadata files (._*)

This stops TextMate from writing it's ._filename metadata files, which can be annoying in mixed environments.

Not mine - from http://blog.amber.org/2006/02/27/stupid-textmate-tricks/

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1