Those who have been waiting with upgrading to TextMate 2.0 should do it before upgrading to Yosemite. While 1.x will function many of the older bundle items rely on outdated system components not available in Yosemite.

This also marks the transition from alpha to beta for 2.0. Don't let the beta designation scare you, this simply signifies that there are still planned features left to add. However it is already leaps and bounds above what 1.x offers with many people already using it in their everyday workflow.

As you transition to 2.0 you will find many great new features and improved bundles made much easier to manage with an included bundle manager in preferences. We have several blog posts detailing some of the new features. If you have problems finding a feature you can ask questions on the mailing list or contact us via email or Twitter. While still a work in progress you can also consult the manual, this will be filled out further in the coming months.

2.0 is a free update to all except those who purchased through Mac Heist for which there will be a modest upgrade fee.

TextMate 2 Basics

Hilton Lipschitz has written a very nice introduction to TextMate 2 containing a lot of great tips and tricks for both the new and the experienced user.

2.0 Status and FAQ

The release of Mavericks has seen a new wave of users switching over to the alpha release so this is a good time to go over the common questions people are having:

Read the rest of the post »

Nested Replacements

While updating the TextMate source to use ARC I needed to update the following code:

NSAutoreleasePool* pool = [NSAutoreleasePool new];
[pool drain];

To use the new autorelease blocks:

@autoreleasepool {

Read the rest of the post »

Beyond Document Scopes

The way to specialize things in TextMate is via the venerable scope selector matched against the current scope.

TextMate 1 created the scope by parsing the document’s content using a language grammar. Though sometimes, more context information is needed than what can be provided by the document’s content, which is why TextMate 2 has extended the information stored in a scope.

Read the rest of the post »

Injection Grammars & Project Variables

I was recently dealing with issue #157 and wanted to store a reference in the source.

Of course this reference should be an underlined link and allow us to easily go to the online issue, yet I don’t want a 50 character long URL in the source, so how do we go about this?

Read the rest of the post »

Ars Technica Interview

Chris Foresman did this nice interview with me.

I hope it clears up some of the confusion that yesterday’s announcement may have left you with.

TextMate 2 at GitHub

Today I am happy to announce that you can find the source for TextMate 2 on GitHub.

I’ve always wanted to allow end-users to tinker with their environment, my ability to do this is what got me excited about programming in the first place, and it is why I created the bundles concept, but there are limits to how much a bundle can do, and with the still growing user base, I think the best move forward is to open source the program.

The choice of license is GPL 3. This is partly to avoid a closed source fork and partly because the hacker in me wants all software to be free (as in speech), so in a time where our platform vendor is taking steps to limit our freedom, this is my small attempt of countering such trend.

I am also a pragmatist and realize that parts of the TextMate code base is useful for other (non-free) applications, so I may later move to a less restrictive license, as is currently the case with the bundles. For now, please get in touch with us if there are subsets of the code base you wish to use for non-free software, and we might be able to work something out.

Anything related to the code base, including contributions, can be discussed at the textmate-dev list or #textmate on freenode.net. Pull requests can be sent via GitHub but if you plan to make larger changes, it might be good to discuss them first if you want to ensure that we are interested in accepting a pull request for such change or simply want advice on how to go about it.

The Layout Engine

As in many other areas, TextMate 2's layout engine has received a bunch of improvements under the hood. It's sometimes hard to show these changes, at least until new features taking advantage of the changes begin to bubble up to the surface. Let's take a tour of some of those new features now, so I can show you just how dynamic what renders has become.

In this article will discuss:

  • The replacement of invisible characters
  • Per-line soft wrap and indented soft wrap
  • Dynamic font sizing
  • Folding pattern upgrades

    Read the rest of the post »

Using Find and Replace

Since the earliest word processors Find and Replace has been a standard feature expected by users editing almost any content. You can score extra points with the programming crowd if you support Regular Expressions, the swiss army knife mini-language of Find and Replace operations. Of course, TextMate 1 had both.

TextMate 2 adds some subtle refinements to this already strong collection of features.

In this article will discuss:

  • Keyboard usage of Find operations
  • New visual feedback provided for these operations
  • How to speed up your searches
  • Enhancements to the Find dialogs

    Read the rest of the post »

Clever Completion

TextMate has always had completion and, as I've said before, it remains the best reason to wear out your (esc) key. The idea is simple and I bet you are already familiar with it, but, just to recap, if I had this Ruby code:

class BoundingBox
  def initialize(min_x, min_y, max_x, max_y)
    @min_x = min_x
    @min_y = min_y

    @max_x = max_x
    @max_y = max_y

I could later use completion to finish off this line:

class BoundingBox
  def max_x=(x)
    fail "max_x must be > min_x" unless @m‸
    # ...

If I push where my caret currently is (shown with above), TextMate will complete the variable reference to @max_y. It starts with @max_y, because that's the closest instance variable reference to my caret (from the bottom of initialize()), meaning it had a high chance to be what I was referring to. It's not really what I wanted though, so another press of cycles me to the second choice of @max_x. That is what I want, so I add > and another @m. Then I can complete until I get @min_x (four presses of or just one press of ⇧⎋ to go backwards, since it's the furthest reference from my caret).

In this article will discuss:

  • Reasons to use completion
  • Suffix completion
  • Prefix completion
  • Mid-word completion
  • Intelligent scoped completion

    Read the rest of the post »

Format Strings

TextMate 1 allowed you to use variable references in Snippets and even to supply defaults or simple replacements for them. TextMate 2 expands a lot on what you can do with variable references and where you can use them.

In this article we will discuss:

  • The syntax of TextMate 2's Format Strings
  • Where you can use them
  • The kinds of tricks these tools can help you accomplish

    Read the rest of the post »

mate and rmate

TextMate is and will always be a modern GUI application. However, developers are often forced to walk in two worlds using both GUI and command-line tools. TextMate has always bridged the gap between these environments with its trusty command-line sidekick: mate.

In TextMate 2, mate has learned some new tricks. A new partner-in-crime has also been introduced: rmate.

In this article will discuss:

Multiple Carets

One of the features user have continually requested for TextMate is the ability to insert multiple carets. Allan, TextMate's developer, was always a little resistant to the idea because it seemed to require the use of a mouse and he's not a mouse guy. Well, he caved. You can now use a mouse to throw down multiple carets and then edit away.

In this article will discuss:

  • Using multiple carets with the mouse
  • Changes to column selection
  • Using multiple carets with Find
  • Using multiple carets with Copy and Paste

    Read the rest of the post »

Whitespace Bundle

Mads Hartmann Jensen has written a bundle which takes advantage of a new injection feature of language grammars to highlight what can be considered improper whitespace. Highlighting both trailing whitespace and mixed tab/space indentation it can also be limited to just one or the other.

(This bundle will only work with the 2.0 alpha.)

Git Style Configuration

TextMate 2 isn't just about adding a ton of killer new features. It's also about throwing out what just plain didn't work. That means you can kiss the old project files goodbye.

Of course, you throw out bad ideas so you can replace them with good ideas.

Project files serve a couple of purposes in TextMate 1. One was to give you access to folders you commonly work with. That's now handled through TextMate 2's File Browser and we're going to talk a lot more about that in the future. Another purpose though was to support project level configuration. Configuration is a great idea, but the old interface was awkward and inflexible.

TextMate 2's new .tm_properties files address this need, similar to .git configuration files.

In this article we'll discuss:

  • The various places TextMate 2 will look for configuration settings
  • Examples of some settings you may wish to tweak
  • Per file type configuration
  • Dynamic project based configuration

    Read the rest of the post »

Locating Bundles

One of the new features in 2.0 is the ability to install new bundles directly from the app. You can see the list of available bundles by opening preferences and going to the Bundles tab. Bundles installed from here will be kept up-to-date automatically. In addition if you try to open a filetype without having the currect bundle TextMate will offer to install it if available.

Also listed are a variety of theme bundles, you can filter list by clicking 'Themes' in the top bar. The Themes bundle is installed by default and includes a collection of themes from 1.x.

For the duration of the alpha we have kept the support files separated so both versions can be run without affecting the other. This means you will have to manually move over your personal bundles and any bundles not available in the installer.

Read the rest of the post »

Alpha Tidbits

  • To create a new file you can use the shortcut ⌥⌘N to create a new tab, when you save this tab it will default to the current or selected directory in the sidebar. Update: When providing the file name (in the save dialog) you can use brace expansion to create multiple files, e.g.: MyView.{mm,h}.
  • The current release will submit non-anonymous crash reports so we can pinpoint problem areas in the alpha. This can be disabled in preferences if needed but it is a great help if you can leave it on.

Around the Web

  • Ernie Miller give a good overview of how to use rmate to edit files on a remote server.
  • David Lanham shows a detailed shot of the new icon he designed for us. Update: David has posted a comment about the process of coming up with the icon.

TextMate 2.0 Alpha

The excitement for a new version has been tremendous and today we’re finally able to repay the much appreciated loyalty and moral support from the community by releasing the first public alpha: TextMate 2.0 alpha.

It’s important to stress though that being an alpha release; it is not complete. It has reached a point where it may suit some early adopters and provide some relief to those who have been questioning TextMate’s future. For the time being, the alpha builds are only for people who already have a TextMate license and an Intel Mac.

Being a complete rewrite there are too many changes to sum up but here is an overview of notable changes since TextMate 1.5.10.

There are also many things that didn’t make it to this alpha, far too many to mention all of them, but a few deserves to be mentioned as they are likely to come up a lot in the coming days:

  • Split views: Yes, I actually had this on the alpha milestone, I’m not overly excited about this feature myself, but I know it’s a very common request, so eventually it should find its way into the application.
  • Full screen mode: This is mainly because we are hesitant to go Lion-only so we are holding back with “lionizing” TextMate till we feel confident we can fully drop backwards compatibility.
  • Performance: Overall performance is fine, but there are still edge-cases that we haven’t looked into, for example the long lines issue which also exists in 1.x or opening files that exhaust TextMate’s memory space.
  • Bundle editor: While a proof-of-concept bundle editor is included, it is provisional, has some flaws, and not how we envision the final bundle editor to be.
  • Settings: Not everything in the Preferences window has an effect at the moment and several menu settings are not sticky, some even revert when switching tabs. Those can be set via .tm_properties — more about this in an upcoming post.