Curated by Carsonified

Learn with Treehouse

Accessibility, CSS3, Design, Django, HTML & CSS, HTML5, JavaScript, jQuery, NoSQL, PHP, Responsive Web Design, Ruby, Ruby on Rails, Tools, UX, Version Control, WordPress, iOS and more

Article 34

The Hidden Magic in TextMate

By

02 September 2010 | Category: Code

TextMate has become an essential part of my development arsenal over the last few years. When you first open up the application, you may be wondering what all the fuss is about- at first glance it looks like any other text editor. The true beauty of TextMate is the plethora of bundles, add-ons, keyboard shortcuts and tab triggers available. I'm going to go through some of my top tips on how to get the most from TextMate and increase your development productivity.

Tip 1: Find Your Perfect Theme

Getting yourself hooked up with the right theme is essential to a good days development. There is a huge amount out there catering for virtually every taste, so make sure to hunt around for one that’s right for you. Personally I have two themes that really hit the right spot for me:

  • Clouds & Clouds Midnight – Two delightful themes especially good for the PHP developer inside you. It comes in two flavors – dark and light, both with strong bold colors that help you work on without getting dreary eyed.
  • IR Black & IR White – This is my go too when I’m cracking on with some Ruby work. Again in dark and light versions with fantastic syntax colors. You’ll also find a nice terminal modification for the theme around too.

Theme choice is very much down to preference and what you’ve been used to before, so when you find the right one for you you’ll know. Make sure to search around and give a few a go, but these two are in my mind a great place to start!

Tip 2: Have the Right Plugins

TextMate comes with a great stockpile of neat features out the box but there are a few things you’ll probably think are missing. Here are a few that I’d call essential to get:

  • MissingDrawer (Resurrected) – One gripe I had with TextMate from the start was the side drawer- mainly because it wasn’t a drawer at all. This plug-in solved my woes. This plug-in is a must for any serious developer.
  • AckMate – As the name suggests, this allows you to run ack within TextMate. TextMate comes with a regular project search, but this is much, much faster when you just want to do a bulk find for something.
  • ReMate – Now this plug-in won’t be useful to everyone, but it certainly is for me. If you work on a network mount in the office you’ll find that every time you switch in and out of TextMate your project refreshes and lags, causing you to wait a few seconds before you can do anything again. This plug-in de-activates the automatic refresh and helps save your sanity from going under!

Tip 3: Get the Best Bundles

Bundles are small add-ons that do great things. If TextMate doesn’t default support a language that you work in (HAML & SASS are prime examples) then you can be darn sure there’s a bundle for it out there somewhere. Bundles add syntax coloring, shortcuts and tab triggers to make your development as fast as it can be.

  • HAML & SASS Bundles – These are perhaps the most common bundles to be installed. If you work in HAML & SASS you’ll want these badly.
  • GIT Bundle – If you use GIT for your version control, then this is a bundle you can’t be without. It allows you to manage your repository from within TextMate, do blame checks and much more. There’s also an SVN Bundle if that’s more your thing.
  • CSS & HTML Bundles – Although TextMate comes with some of it’s own, you’re going to want to grab the ones from Minimal Design. They add fantastic tab triggers to virtually eliminate most typing.
  • jQuery Bundle – A great bundle for working with jQuery. Features tab triggers for many functions and some pretty good syntax highlighting.

Tip 4: Use those Sexy Shortcuts

This is where TextMate really comes into it’s own. You can find a shortcut for virtually any function to help you on your way to productivity success. There’s far too many to mention them all, but these are some of the key combos that I use on a daily basis.

  • ⌘T Go to File – This shortcut is truly second to none. Instead of trawling through your project drawer or going through the folders in your finder, use this to quickly jump straight to any file you wish to be in.
  • ⇧⌘TGo to Symbol – This works in the same way as Go to File but for within a specific file. Trying to find a set method or a global variable? Look no further good sir, this is what you need. Especially useful for when you’re working with a massive user model!
  • ⌘LGo to Line – If you’re debugging a stack trace, you’ll want to remember this one. Jump to an exact point within a file to squash that nasty bug!
  • ⇧⌘LSelect Line – Select the entire line of code you’re working on. Chances are you may want to follow it up with…
  • ⌃⌘ + ARROWMove Code – Move the selected code around the file, helps when doing some refactoring of that nasty functional code.
  • ⇧⌃⌥VSend selected to Pastie – This one is pretty unknown but handy. Send the selected code over to Pastie with a private URL for sharing the code – great when you need some feedback from a fellow developer.
  • ⌃SSimple Search – Most folks know about ⌘F as it’s the same in most applications. However in TextMate it loads up an additional window for find and replace which isn’t always what you want. This shortcut allows you to do a quick search in the current file iteratively.
  • ⌘] and ⌘[Block indentation – Indenting manually can be a pain – use these functions to indent blocks of code quickly and easily.
  • ⇧⌃TTo-do list – This feature scans the project for code marked as ‘FIXME’, ‘TODO’ and ‘CHANGED’. It provides an informative list of them along with comments.

Make sure to do some googling for even more handy functions – if you can think of it, it’s probably there!

Tip 5: Learn your Tab Triggers

Tab triggers are for quick code completion and are invaluable to the well-trained TextMate user. For example typing doctype TAB will give you the option of inserting the appropriate doctype of your choice into your document, even HTML5 if you have that bundle installed.

The triggers are different bundle to bundle, language to language, so make sure to check out your specific bundle for more details.

Where to go From Here?

The best way to learn TextMate is to use it and explore. Try new shortcuts out, look into the gears menu and google until your hearts content.

Also, if you have something specific that you find useful in TextMate, make sure to share it in the comments. One of the best ways to learn the secrets of TextMate is from each other!

Follow @thinkvitamin on Twitter Please check out Treehouse

Other Posts You Might Find Interesting

  • Sorry - No Related Posts Found

Comments

  • Jayphen

    Does anyone have a bundle for the new SASS format?

  • Jayphen

    Does anyone have a bundle for the new SASS format?

  • Michael Gauthier

    I started using Textmate and found it a great editor for the Mac. Then I discovered Coda, and I would recommend Coda over Textmate to anyone! Coda is a great editor, and allows you to set up profiles whereby you can have ftp, svn, and ssh interfaces all within the same application. Very intuitive.

  • Michael Gauthier

    I started using Textmate and found it a great editor for the Mac. Then I discovered Coda, and I would recommend Coda over Textmate to anyone! Coda is a great editor, and allows you to set up profiles whereby you can have ftp, svn, and ssh interfaces all within the same application. Very intuitive.

  • http://www.collectivecore.com Chris Lentz

    Great article! I have been using Textmate for years, and absolutely love it.

  • http://www.collectivecore.com Chris Lentz

    Great article! I have been using Textmate for years, and absolutely love it.

  • http://omniation.com Dan Palmer

    The best bundle is GetBundles. UI for browsing and installing bundles from several locations within TextMate itself.

  • http://omniation.com Dan Palmer

    The best bundle is GetBundles. UI for browsing and installing bundles from several locations within TextMate itself.

  • http://twitter.com/jordanbrown Jordan Brown

    Couldnt agree more Dan. I also like the wordpress plugin if you create alot of wordpress themes. – Search wordpress in GetBundles by shawn parker. http://al3x.net/2008/12/03/how-i-use-textmate.html

  • http://twitter.com/jordanbrown Jordan Brown

    Couldnt agree more Dan. I also like the wordpress plugin if you create alot of wordpress themes. – Search wordpress in GetBundles by shawn parker. http://al3x.net/2008/12/03/how-i-use-textmate.html

  • http://bobbelderbos.com/ Bob Belderbos

    Hi Nick,
    Thanks for this great post. Textmate is by far the best text editor out there.
    Sometimes I am bound to Linux and I became to appreciate gedit as well: http://bit.ly/c4xbxO
    Bob

  • http://bobbelderbos.com/ Bob Belderbos

    Hi Nick,
    Thanks for this great post. Textmate is by far the best text editor out there.
    Sometimes I am bound to Linux and I became to appreciate gedit as well: http://bit.ly/c4xbxO
    Bob

  • http://fordinteractive.com Andy Ford

    gotta love: lorem TAB

  • http://fordinteractive.com Andy Ford

    gotta love: lorem TAB

  • MrQwest

    Being relatively new to the Mac scene, and text mate as a code editor, this is a great post with some nice tips! Ive not had much time to sit down and get to know text mate, but the tips here will certainly help speed up the process!

  • MrQwest

    Being relatively new to the Mac scene, and text mate as a code editor, this is a great post with some nice tips! Ive not had much time to sit down and get to know text mate, but the tips here will certainly help speed up the process!

  • http://www.ericlightbody.com Eric Lightbody

    I definitely agree with GetBundles. Also, zen coding: http://code.google.com/p/zen-coding/

  • http://www.ericlightbody.com Eric Lightbody

    I definitely agree with GetBundles. Also, zen coding: http://code.google.com/p/zen-coding/

  • http://montanaflynn.me Montana Flynn

    I agree with Dan, so many bundles are available! I just got the CSS3 & HTML5 bundles and they rock.

  • http://montanaflynn.me Montana Flynn

    I agree with Dan, so many bundles are available! I just got the CSS3 & HTML5 bundles and they rock.

  • http://www.writeyourbookmasterclass.com Tiffany

    For me, HAML & SASS bundles are the best. It worked perfect for me. :)

  • http://www.writeyourbookmasterclass.com Tiffany

    For me, HAML & SASS bundles are the best. It worked perfect for me. :)

  • http://www.benhayes.com Ben Hayes

    Will have to give TextMate a look sometime.

    Personally I find VIM amazingly good to use, mainly because of the reasons you discuss here. Although there is probably a bit of a steeper learning curve, you really can control everything from the keyboard (in fact I never touch the mouse in VIM, as it’s command-line driven). You can do regular expressions, and navigate around as fast as you like, all without letting your fingers drift from the standard touch-typist position.

  • http://www.benhayes.com Ben Hayes

    Will have to give TextMate a look sometime.

    Personally I find VIM amazingly good to use, mainly because of the reasons you discuss here. Although there is probably a bit of a steeper learning curve, you really can control everything from the keyboard (in fact I never touch the mouse in VIM, as it’s command-line driven). You can do regular expressions, and navigate around as fast as you like, all without letting your fingers drift from the standard touch-typist position.

  • http://nickpellant.com Nick Pellant

    I too have found some pleasure in Coda, and it’s a great piece of kit. For me though the move was to TextMate from Coda- I just found that when you want to get more nitty-gritty with each aspect of your development process, greater control was required which one singular IDE couldn’t provide for me.

  • http://nickpellant.com Nick Pellant

    I too have found some pleasure in Coda, and it’s a great piece of kit. For me though the move was to TextMate from Coda- I just found that when you want to get more nitty-gritty with each aspect of your development process, greater control was required which one singular IDE couldn’t provide for me.

  • http://nickpellant.com Nick Pellant

    Ah yes! I used to have this installed on an old setup however it seemed to have disappeared from my current one- thanks for the reminder! This bundle is definitely a must have.

  • http://nickpellant.com Nick Pellant

    Ah yes! I used to have this installed on an old setup however it seemed to have disappeared from my current one- thanks for the reminder! This bundle is definitely a must have.

  • http://www.onenotereview.com/ Onenote

    I am started using text mate few days back before. It can control everything from the keyboard . we can do regular expressions and it’s a great editor. It’s good one. I want become in this editor. I found Microsoft office onenote expert. This is nice one. You’ve given very good tips on text mate. Nice one. Thank you.

  • http://www.onenotereview.com/ Onenote

    I am started using text mate few days back before. It can control everything from the keyboard . we can do regular expressions and it’s a great editor. It’s good one. I want become in this editor. I found Microsoft office onenote expert. This is nice one. You’ve given very good tips on text mate. Nice one. Thank you.

  • http://www.dmora.com Daniel Mora

    I like using CSSEdit and Espresso myself.

  • http://www.dmora.com Daniel Mora

    I like using CSSEdit and Espresso myself.

  • http://kurtzenter.com Alex

    +1 zen-coding speeds up your day!

  • http://kurtzenter.com Alex

    +1 zen-coding speeds up your day!

Badges for Treehouse

Treehouse

Learn iOS, Rails, CSS3, jQuery, Node.js, HTML5, UX and more in less than 8 minutes per day. New videos added regularly. Sign up today and get a free Web Design Toolkit.

Ads Via The Deck

Think Vitamin Radio
Episode #34: Amazon Fire and Responsive Roundtable

Check out our bi-weekly radio show. Covering the hot topics on the web.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Download Podcast as mp3

Advisory Board

The Think Vitamin Advisory Board in place make sure that you receive the best content possible.