TextMate Hacks
TextMate is a neat new editor for
Mac OS X. In its early stages it lacks some syntax coloring
modes. I have hacked together a couple of quick ones for public
use.
However, these versions are all obsolete. The latest versions are available at the TextMate SVN site: http://anon:anon@macromates.com/svn/Bundles/trunk
- Universal UnComment Bundle (updated 12-23-04)
- This is a TextMate command to toggle comment status of selected text
for arbitrary languages. Install it by double-clicking on the ungzipped tmbundle.
- It parses the filetype from the filename ending and checks if the selection's first line is a comment; if so, it uncomments the rest of the selection.
- If not, it comments the whole selection, line by line. It tries to keep the selection's indentation.
- If a language has more than one kind of delimiter pair, it will use the first pair in the list for commenting, and will search for all listed pairs for uncommenting.
- Notice this last feature improves on BBEdit's Text->Un/Comment functionality.
- The delimiters are stored in $markers in the format "a,b,c"=>[$first, $last], where each of the file endings .a, .b and .c will use that delimiter pair. Roll your own! (But let me know so I can update the bundle.)
- Perl Bundle (updated 12-21-04)
- written by Eric Hsu, Noah Daniels and Martin Vetter
- The package consists of a syntax highlighting file and a few handy commands:
- Perl Comment Toggle (turns uncomments comments, comments code)
- Perldoc Search
- Perl Send to Affrus (requires Affrus, obviously)
- Perl List subroutines
- PerlTidy (requires PerlTidy from http://perltidy.sourceforge.net/, may need to tweak path)
- Perl Error Report
- Perl to One-liner (strips comments and extra whitespace, e.g. for use in perl -e)
- Changes (12-20-04)
- Martin Vetter added [] and () to the Perl folding syntax.
- __DATA__ now highlights to the end
- q qq qw qx quoting is nicer
- Known problems: here-docs not quoted, many autoquotes not highlighted right, e.g. hashkeys in => notation.
- Noah Daniels submitted bug fix to color POD starting with ^= and not just ^=head1
- Noah Daniels also submitted bug fix for $#foo being counted as a comment.
- Changes (12-10-04)
- recognizes more syntax (thanks to Xavier Noria for bug report)
- adjusted $foo{bar} so the first brace isn't highlighted
- q qq qw qx quoting recognized
- POD recognized (from =head1 to =cut)
- __END__ __DATA__, __FOO__ all recognized
- added Perl to One-liner
- Known problems: many autoquotes not highlighted right; here-docs not quoted, hashkeys in brace notation.
Show Invisibles Bundle Hack (updated 1-20-05)
- Tabs get one color. Spaces get another.
- All other non-ASCII non-printing characters (gremlins) show up in a
different color. Edit the files if your idea of gremlins isn't my idea.
- Added Stupefy Quotes/Hyphens and Zap non-ASCII commands.
Perl Bundle 11-25-04
- added auto-indent
- added file test operator syntax highlighting
Perl Bundle 11-5-04
- added Perl Error Check, Perl Tidy, and Find Subroutines
commands.
- you can get source for Perl Tidy from
http://perltidy.sourceforge.net/
Perl Bundle 10-17-04
- added "Perl Comment Toggle"
- highlight text and it will toggle the comment status of
the line. if there are multiple lines, if will comment or
uncomment all of them depending on the first line.
- removed // as comment marker
- made comments slightly darker
Perl Bundle 10-14-04
- added "Send to Affrus" command
- added "Perldoc Search" command: highlight a word and
get a window of perldoc
- added .pm to recognized filetypes.
- Just a quick hack
- based on PHP S.D. by (Justin French, Sune Foldager,
Allan Odgaard)
- Doesn't recognize all special variables, just $1, ...,
$9 and $_, @_.
LaTeX Bundle 10-12-04

Please
send comments/additions to Eric Hsu.