TextMate News
Anything vaguely related to TextMate and macOS.
Posted by Allan Odgaard
Self updating build
Last month I added an appcast for TextMate. This was done so that I can release updates more frequently, and frankly, not care so much about “actual” releases, which is part of the reason to why there have been no actual betas since I started doing nightly builds.
Posted by Allan Odgaard
HTML output for commands
As you probably know, TextMate derives a lot of power from the underlying shell infrastructure in OS X. A place where this is evident is in the bundle editor, which allow you to (amongst others) setup (shell) commands and scripts to run.
Other than export various shell variables to the command, TextMate give you control over what the command should receive as input (stdin) and what to do with the output (stdout). One output option is to show it as HTML, which allow for more than just pretty printing the result. I’ll give some examples of that in this post.
Posted by Allan Odgaard
Shell variables
When you execute a shell command/script from TextMate, it exposes a lot of information as shell variables (file path, project folder, current word, selection, caret position a.s.o.) which you can work with in your script.
You may often want to do miscellaneous transformations on the variables, and bash supports quite a lot of neat syntax to do so, so what follows is a short tutorial with examples. I have picked what I consider the most useful stuff, for the full list there’s man bash
.
Posted by Allan Odgaard
Handling encodings (UTF-8)
From time to time I’m asked to extend the number of encodings supported by TextMate. My answer is normally that the user should be using UTF-8, so here’s a bit of history, reasons for using UTF-8, and tips about handling it in miscellaneous contexts.
Posted by Allan Odgaard
RSS feed with latest build
I have created an RSS feed for the TextMate changelog which has the actual build (i.e. with the changes) as an enclosure.
Posted by Allan Odgaard
Beta 17 notes
Beta 17 of 1.1 was released yesterday, and the major new cool thing is the new snippet capabilities. I already dedicated an entire post about snippets, but as a bonus I recorded a movie showing some intelligent snippets.
Posted by Allan Odgaard
The power of snippets
Version 1.1b17 is falling a little behind schedule, so just to signal that I’m still alive, here’s a teaser about how the snippet system has been enhanced in the upcoming beta.
2005-10-11: Added paragraph about regexp replacements performed on variables.
Posted by Allan Odgaard
Tips and tricks
I was asked on IRC today if TextMate could show the changes from last time the document was saved, and was also informed that smart-typing of quotes conflicts with Pythons triple-quoted strings.
Both things turns out to be surprisingly simple to fix for the user, and since this isn’t the first time I’ve been asked for features where the solution expose TextMate’s ease of customization, I figured it was time to start a Tips and Tricks category on this blog.
Posted by Allan Odgaard
Universal binary (and more)
Time flies when you’re having fun, so it took a bit longer than promised with that universal build (and Panther workaround). But latest beta is built both for PPC and x86. I don’t have the x86 system myself, so the testing has been done by a user who requested the build some time ago.
Other than that, beta 16 has the usual list of improvements (which is generally half of what I schedule for the release ;) ).
Posted by Allan Odgaard
Miscellaneous beta 15 notes
As you may have noticed, beta 15 was released today (though only as a PPC binary, since I haven’t updated my deployment script yet – I’ll put up a universal build shortly). I’m preparing for the official 1.1 release, so I’m holding back a little on new features and am instead cleaning up the existing stuff.
Posted by Allan Odgaard
Introduction to scopes
Problem
Text editors often have different modes for different file types. For example it can have a Java mode with appropriate build actions defined, and another mode for LaTeX.
This system doesn’t work for documents with mixed languages. For example HTML can embed ASP, Java, JavaScript, PHP, Ruby, Tcl, and probably half a dozen other languages. So what happens if we write for
in an HTML document and press tab (to expand the for
-loop)? Some editors solve this by creating new modes for the combinations, like HTML+PHP. But this isn’t a complete solution, since HTML+PHP can still contain both JavaScript and PHP, so we’d still not know how to expand the for
keyword.
Posted by Allan Odgaard
Key bindings for switchers
This entry isn’t just for switchers, but I’ve gotten several requests for making the home/end function keys go to the beginning/end of current line, which is how Windows does it, hence the title.
While this is possible to setup within TextMate, I’m certain that the people requesting this would be happier with a solution that applies to all good OS X citizens (i.e. who make use of the standard key bindings system like Mail, Safari and other Cocoa applications). So here’s a detailed description of how to achieve this and more.
Posted by Allan Odgaard
Language grammars
Since I made beta 6 and onward unofficial, I’ve been quiet about new features, despite my plan (that, and being a lazy writer). Though seeing how 41% of users are using the “unofficial” betas, I’m going back to “normal” beta releases.
As for labeling these releases betas, at least two anonymous posts think I should call them alpha. For me alpha is something which crashes, and if alpha means feature incomplete and beta is feature complete, I’m afraid TextMate won’t leave alpha for a long long time. But I’ll probably annotate them with some descriptive term sometime in the future, which would clarify the state and also allow me to release something equivalent of nightly builds.
But enough about that, let’s take a look at one of the major new features (though for anyone with the time, I strongly encourage reading the full release notes for each new (beta) release)…
Posted by Allan Odgaard
Code sense
Mats Persson has been busy augmenting TextMate with a bundle for PHP function completions and other nice things like a tooltip to show function prototypes and similar.
I realize that the desire for language specific auto-completion (code sense) is high. So far I’ve held back on providing a proper (plugin) interface for this, since I do most of my work in C++, and here proper code sense requires a rather complete C++ parser, which is not easy to write (so I didn’t thought anyone would, even if I did provide the proper API).
But TextMate is a general purpose text editor and should not be held back just because C++ is overly complex to parse. So I’m currently working on a plugin API for plugins to show an unobtrusive completion menu below the text typed, here’s a picture (click for full size):
As the picture implies, I’m also working on the actual plugin for Objective-C/C++ (which is the hard part), I’m using ANTLR for this task. If you’re into writing parsers and feel like giving me a hand, please do :)
Oh… and just in case you’re following Steve Jobs advice and are moving to Xcode, remember that TextMate can (thanks to Chris Thomas) build Xcode project files with a very nice output. So just drag your project folder to TextMate’s application icon, open a source and press ⌘B followed by ⌘R (if there were no errors). There are also commands (by Chris) to import Xcode projects (located in the source bundle).
Posted by Allan Odgaard
Beta versus release versions
As some may have noticed, beta 6 was released as an unofficial release (i.e. even if you’ve enabled beta checks in the software update preferences, it wouldn’t appear). Dan asked if these unofficial versions were to be considered more as alphas than betas, so let me clarify on how I view beta versions (since I don’t think there is any consensus on what alpha and beta versions really mean).
Update: Now it’s 1.1 beta 12 (but please read this entry before just downloading, this beta requires 10.3.9 or higher). Beta 12 includes these bundles: C/C++, CSS, Diff, HTML, Language Definition, Latex, Markdown, Math, Objective-C, PHP, Property List, Ruby, Source, Subversion, Text Utilities, Unix Shell, and Web Searches. For additional bundles you’ll currently need to do a svn checkout.
Posted by Allan Odgaard
User contributions
Beta 6 will take a little longer than usual, since I’m making major changes to the syntax system which should allow for some neat new stuff (and shared styles among different languages, if desired).
Though if you miss the bi-weekly update then there are other sources for new TextMate stuff!
Posted by Allan Odgaard
Beta 5 is here
More than a week has passed since beta 4, so I figured it was time for a new beta. As always (starting from beta 3) I’ll be mentioning the highlights of this new release in my blog (which is this one).
Posted by Allan Odgaard
TextMate IRC Channel
For the last week I’ve been trying to have Colloquy running in the background connected to #textmate at freenode. So if you want to chat with me or other TextMate users, here’s your chance!
Of course you can also follow the recent trend of posting your critique to MacUpdate or VersionTracker, but there is a higher chance of a reply if you write me directly.
Posted by Allan Odgaard
External Editor API
Beta 4 (unintentionally) broke the external editor API (for using TextMate as text editor in ftp programs) which also affects the TextMate service announced only days before beta 4 (how ironic).
You can still download beta 3 if you need this feature to work. I plan to release beta 5 ASAP (which should mean in 1-2 days) with a fix for the problem.
Sorry about any inconvenience this may have caused you!
Update: I gave into pressure and re-uploaded beta 4 with a fix for the external editor problem. So if you can’t wait for beta 5, you can also re-download beta 4.
Posted by Allan Odgaard
Beta 4 highlights
As previously mentioned I’ll try to showcase one or two features with each new (beta) release. This time my favorite addition is the ability to show command output as HTML. As with a lot in TextMate, don’t let the apparent simplicity fool you.
With the addition of the txmt://
custom URL scheme it is possible to have an HTML page link to a file/line/column in TextMate, and together with having the output shown as HTML, we can for example use curl
to post the current buffer to W3C’s validating service and pipe the result through Perl, to have the supplied line/column information rewritten as txmt://
anchors that take us to the erroneous line (all without leaving TextMate).
The same can be done for LaTeX compile errors, but here we can take it a step further by downloading Schubert’s PDF Browser Plugin. This allows us to view PDF in our browser, and so, we do the normal thing for compile errors, but if there are no errors, we simple redirect the embedded browser to the PDF file. I have recorded a small movie which shows this in action.