TextMate News
Anything vaguely related to TextMate and macOS.
Posted by Allan Odgaard
Japanese Manual
Thanks to the work of Takaaki Kato there now is a Japanese TextMate manual.
A few things still need to be translated (there is an issue tracker) but it should already be very useful for people who prefer reading Japanese over English.
And no, this does not mean that a new CJK-compliant TextMate has been released. The best approach for using CJK with TextMate is still via the plug-in.
Posted by Allan Odgaard
Working With History in Bash
Yesterday we talked about favorite bash features (on the ##textmate
IRC channel). I figured it was worth posting mine to this blog, they mostly revolve around history, hence the title.
Posted by Allan Odgaard
TextMate (Ruby) Tricks
John Muchow of Mac Developer Tips recently posted a screencast showing a neat way to debug your Ruby code.
Speaking of the Ruby bundle, Ciarán Walsh has a post about the design philosophy behind the mnemonics of the Ruby bundle and a few highlights.
And while there seems to be a preference for writing TextMate commands in Ruby, anything that you can run from a terminal (shell) can be used. A step-by-step tutorial about how to write TextMate commands in PHP is available at Ciarán’s blog. I pushed him to write this one, as I believe there are a lot of people who work with PHP in TextMate that never got around to writing custom commands in the false belief that they would have to learn elisp or some similarly obscure language :)
Posted by Allan Odgaard
ExpanDrive — Seamless sftp mounts
Not so long ago Jonathan Ragan-Kelley mentioned ExpanDrive on the mailing list and I assume it is the same Jonathan R. quoted on their page as saying:
I’ve never seen TextMate work well on a network drive. With ExpanDrive, it’s a dream. And the drives stay mounted perfectly when I move my laptop between home and work.
John Gruber just posted a review about ExpanDrive in which he writes:
My first impression after reading ExpanDrive’s promotional description last week was that it sounded too good to be true. One week later, I’m pretty sure it actually is that good.
If it wasn’t clear from the above, ExpanDrive lets you mount remote sftp drives and it actually works! I.e. no long delays or dropped connection in the middle of a save. Their introductory price is $29.
2008-03-11: Update: There is a $5 discount for the first 100 who use UWQ0OUQZWIB1ZMTP
as coupon code.
Posted by Allan Odgaard
Changes — FileMerge Replacement
Ian Baird recently released Changes which is an application to show differences between two folders and merge these intelligently.
I know this is not an uncommon task among many TextMate users, as I have received quite a lot of requests for building such functionality — Changes of course has TextMate integration, so this application will hopefully satisfy a lot of you.
Version 1.0 of Changes is available for $39.95 (free trial) but if you use TEXTMATE0308
as coupon code you can get it for $29.95 (offer lasts throughout March 2008).
Posted by Allan Odgaard
Git Bundle
You may have read that a lot of prominent people have recently moved to Git and are loving it. I too am one of those who fancy this new kid on the block but never got very far with the bundle I started for it.
Fortunately Tim Harper recently picked up on my initial efforts and has done a great job at not only making this bundle functional but also downright impressive :)
The much improved Git bundle can be found at Gitorious and discussion about it can be directed to its Google Group.
For those too lazy to click the link above, here are the short install instructions:
mkdir -p /Library/Application\ Support/TextMate/Bundles
cd !$
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'
After having installed it you can press ⌃⌘T in TextMate and enter git
to find the “Administration → Update Git Bundle” action. Use this to update the bundle (it will automatically reload after having performed the update).
Posted by Allan Odgaard
From Bash to Z Shell
If your usage of Mac OS X is the slightest bit “technical” then you should do yourself the favor of getting familiar with the extremely powerful shell environment.
Even if you already know a dozen scripting languages far more expressive than the shell, there are still contexts in which the shell is just better suited for the job, and understanding the POSIX environment is knowledge that is very valuable even outside the shell.
James Edward Gray has a review of From Bash to Z Shell which sounds like just the book you want to pick up, quoting from his review:
I’ve already noticed dramatic differences. I’m using shell loops at the command-line now to process many files at once; I actually understand shell quoting and when to use which types of quotes and escapes to get the desired effect; I can easily strip off a file extension or get a directory name from a full path when I need one; I make constant use of the command history now whether I’m searching for a past command, correcting a typo, or just pulling a single argument out of a previous command for reuse in a new command; and I’ve written a few shell functions to provide shortcuts to my common tasks.
Posted by Allan Odgaard
Eye on TextMate Bundles
Luke Daley took initiative to have FishEye index the TextMate Bundles repository.
A neat thing about FishEye (in addition to the “lines of code”-graph shown below) is that it allows per-folder RSS feeds.
Posted by Allan Odgaard
Right-Aligned Snippet Placeholders
The other day Abhi Beckert asked (on IRC) how to ensure right-aligned text in a snippet. That is, after the snippet has been first inserted, it reads:
# --------------------
# Header
# --------------------
Here Header
is a placeholder which we can overtype. When we fill in the actual header name (for example Configuration
) the text should be formatted like:
# --------------------
# Configuration
# --------------------
The trick to solving this problem is by using conditional insertions in the replacement string.
Posted by Allan Odgaard
Logitech Control Center
Seems the infamous Logitech Control Center is back to wreak havoc.
They released a 2.4 update on the 20th of November and a week later a “mate error” thread surfaced on the mailing list, I have received a dozen support emails about the problem, and if you look at the comments for LCC at VersionTracker or MacUpdate, you’ll find that a lot of users are reporting problems with this update.
So my advice: uninstall LCC. And on a more general note, if something has worked fine for a year, and it suddenly breaks, consider what you did to alter your system in the last week before you write support, thanks! :)
Posted by Allan Odgaard
TextMate Tips
I indirectly plugged Ciarán Walsh’s blog in a previous post about hacking TextMate. Though it is worth mentioning it again, especially the TextMate tips category.
Ale Muñoz (maintainer of the ActionScript bundle) runs a blog that has a Flash / ActionScript / TextMate focus, I haven’t linked to it before, so I hereby am making up for that.
Lastly let me send some link love to Thomas Aylott’s projects: his blog, post about his Leopard theme for TextMate, and BundleForge.
Posted by Allan Odgaard
Leopard Issues
This post is meant to clarify a few Leopard related issues.
Posted by Allan Odgaard
Open in TextMate
Open in TextMate allows you to open the current folder or selection from Finder as a TextMate project. There are a few scripts for this, but this one is the latest iteration and it comes with a nice icon that fits will into the Finder tool bar.
Henrik also provides tool bar items for Open in Terminal and Glob Select which are definitely also worth checking out!
And for the records, this is not related to “Edit in TextMate”
Posted by Allan Odgaard
InputManagers on Leopard
Contrary to most rumors, input managers still work on Leopard (at least on my pre-GM seed), but for an input manager to be loaded there are now a few requirements it needs to fulfill.
Posted by Allan Odgaard
Recursion in Regular Expressions
Robin Houston (author of the original proposal for extending regular expressions to support recursion) gave an example of how to use this feature to match properly nested parentheses on the TextMate mailing list.
Posted by Allan Odgaard
File Type Detection (RSpec & Rails)
To enable the functionality offered for a given file type, it is important that TextMate actually detects it.
In this post I will go through the 3 steps used to detect your file’s type and then answer the question of how to make TextMate automatically recognize rspec
files (for those who have bound .rb
to Ruby on Rails).
Posted by Allan Odgaard
Hacking TextMate
Hans-Jörg Bibiko decided he couldn’t wait for a real scripting API (i.e. allowing you to remote control TextMate) and wrote TMTOOLS
, a shell command that works as a mini interpreter where the commands are all TextMate actions.
You can find the help file for TMTOOLS here and his latest mailing list letter about TMTOOLS here.
Speaking of hacking, Ciarán Walsh (maintainer of the PHP and SQL bundles, and contributor extraordinaire) recently started a blog with several TM hacks, for example to make the project drawer show Finder labels or Subversion status.
Also on his blog is a glyph input manager which add the functionality mentioned in the multi-stroke key bindings post but which does not require you to remember the arcane multi-stroke key bindings (Leopard users have a look at the release notes).
On his site, but not on his blog, is also a ReMate plug-in to disable the auto-updating of the project drawer (the feature that drives people working over network connections insane). Another approach to this problem is by Rob McBroom who recently announced a Remote Project bundle on the mailing list.
Disclaimer: With the exception of Rob’s bundle, the above is all based on undocumented functionality or using things in ways they were not supposed to be used, i.e. end user innovation.
Posted by Allan Odgaard
Interview from NYC
In August, while visiting the states, I met up with John Joseph Bachir who did an interview with me.
It was done “live to tape” and he has since transcribed it. I think it turned out really good, and I had a fun time doing it, so thanks to John for taking the time for this.
Posted by Allan Odgaard
Obfuscating Emails Revisited
The outcome of my last entry about obfuscating email addresses is the HTML → Encrypt Selection (ROT13) command which replaces the current selection with JavaScript to output it (with the actual markup stored in ROT13).
Since most of my pages are already preprocessed, I decided to turn it into a general filter that works on a full HTML page. It replaces all document nodes (which contain an email address) with the corresponding JavaScript.
Since it has given me much joy to once again be able to write plain email addresses in my pages (without worrying about spam harvesters) I figured I should share :) But do double-check that the result you get from the filter is actually what you expect — the parser used is written for (my) valid HTML pages with potential script tags (such as <% … %>
and <?php … ?>
).
By replacing the full document node with a <script> … </script>
-construct it should keep the resulting page as well-formed. Though the filter inserts a <noscript>
-tag to improve usability (for clients without JavaScript) but the <noscript>
-tag is a block-level tag, so this will generally make the page non-valid. If you want a validating page then you can remove the <noscript>
stuff at line 119.
I have pondered a few ways to keep the page as valid and still insert a <noscript>
-tag, but I think the best approach would be to instead have the <noscript>
-content be the default content, and then use JavaScript to replace that (so avoid using the <noscript>
-tag). Ideally the fallback content should be a human-decodable version of the email address.
If anyone ports the filter to PHP please let me know, as I would love to turn it into a WordPress plug-in.
Posted by Allan Odgaard
Silverlight & TextMate
Cédric Bleimling directed my attention toward the video tutorial site for Microsoft Silverlight. Not only are they using TextMate for the screencast, they put its icon on the graphics for the download.
Clearly the message has been well received in Redmond :)