views:

1415

answers:

9

I use the latest version of textmate for all my Rails development needs and I feel that I'm under-using the possibilities or this software. I only installed the Ruby on Rails bundle and use little to no snippets / shortcuts.

What do I absolutely HAVE to know / do in order to get the most out of my textmate in a web development environment?

I would prefer Ruby on Rails oriented answers, but any html/js/css answers would be helpful.

Edit: Added a bounty to get more inputs on this.

+10  A: 

I was on the same boat some time ago. My biggest advice would be to reserve some time to learning your tool. It will do wonders to your productivy.

I started installing the GetBundles bundle:

  cd ~/Library/Application\ Support/TextMate/Bundles
  svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/

With it, you can check and find new bundles. Be sure to go through most of the options of each one you install.

Next, try learning some Textmate skills. I'd recommend the Peepcode screencast. It covers Rails related productivy tips and information, and will give you some new ways to develop.

Then, you try reading most Textmate tips you can find on the Internet. There are a few I read from time to time: Textmate Tips, Cool Textmate Tips, Textmate Tips from Macromates, Mactips, Textmate Productivity Tips.

There is a Textmate book, but haven't been able to get into it yet. Should be useful, though.

Lastly, the best way to improve your skills is to practice. I try to come up with small week-length projects to use new tips or to remember features I had forgotten.

Good luck :)

Yaraher
Thanks this is really helpful, I'll check it out and come back here to talk about it
marcgg
And try to make sure you know how to create your own commands and snippets... its a massive productivity tool.
Sudhir Jonathan
+2  A: 

I've been using TextMate for a while now, and one of the best things about the application is the ability to extend it using bundles. As Yaraher said, there are lots of resources out there, and you should go and take a look.

My only other piece of advice is this: when you find yourself doing something with TextMate over and over, and it is a pain, or you think that it could really do with this or that feature, think about how you could do that with your favourite scripting language. If you can write a script for your feature, you can add it as a command that TextMate can use - have a look at the bundle editor (Ctrl+Opt+Cmd+B) and the existing commands, it is pretty straightforward.

accuser
+2  A: 

Ctrl-Cmd-T allows you to search for commands, so every time I want to do something new (like a validation macro) I hit Ctrl-Cmd-T, type vpo and it finds the correct macro for validate_presence_of, and even tells me to just type v-p-TAB next time. It's quite the education.

Also, I managed to use text mate for a year without realising that Esc auto completed. Don't miss that one.

Ctrl+Opt+Cmd+V to see your clipboard history is also a life saver.

cwninja
+1  A: 

Probably the most useful TextMate trick I've found out about is Cmd-T, which shows a quick open dialog for the files in a project.

Another good trick I've learned is opening a TextMate project from Terminal (assuming you installed the TextMate Terminal Usage [via the Help menu]). mate . from the Terminal will open a TextMate project from the current directory.

If you watch Railscasts, you'll see how useful the various text completion and other Bundle options are. I'd second Yaraher in checking out all the stuff in the Rails bundle (Cmd+Opt+Ctrl+B).

Max Masnick
+1  A: 

I can recommend looking at these (Note: PDFs):

http://pragmaticstudio.com/rails (Rails TextMate Cheat Sheet)

http://www.g-design.net/textmate.pdf (HTML/CSS/Javascript/Other TextMate Cheat Sheet)

It would also be beneficial to look at the bundle editor (Cmd+Opt+Ctrl+B) and just look around at how the general bundles are setup. I did that, then shortly after started making little snippets in my own bundle to expedite things which I do most often.

Hope this helps, and good luck!

Eric
+1  A: 

Not Rails-related, but I can't say enough good things about the Zen Coding plugins for HTML & CSS coding. A huge bunch of keyboard shortcuts that will completely change the way you use Textmate (if you do a lot of XHTML/CSS like I do). Watch the Screencasts to see just how quickly you can do common tasks with them.

Another plugin that's been super awesome for me along the same lines is the jQuery Bundle that adds keyboard shortcuts for a bunch of jQuery methods.

Essentially, what I'm getting at here, is that with some diligent searching you can uncover a ton of community-built addons for Textmate that increase the functionality of this already awesome program.

Most of the coders in my office use some variant of Eclipse, but I say they can pry my copy of Textmate from my cold, dead hands. :D

Scottie
A: 

Indeed, take a look at the bundles that are available and definitly keep it in mind if you find that you are repeating or using the same stuff a lot. You'll end up with a lot of snippets in no time!

Think like <link rel="stylesheet" href="/public/stylesheets/screen.css"> can very easily be extracted into a snippet so the only thing you would have to type would be the link to the stylesheet itself.

This might seem like not a big deal but just think about the amount of times you've had to type something like this. Mastering Textmate is all about saving yourself from unnecessary keystrokes and making it work for you instead of the other way around.

Bitterzoet
+1  A: 

Cmd-T ENTER lets you go back to the file you were previously editing. This is specially useful as TextMate doesn't support window split.

Also, check out the rails-footnotes plugin. It adds links to the bottom of your rail-app layout that automatically open the view or controller files in TextMate. Those links only appear in development mode.

Some of the other features that I use frequently are:

  • Duplicate line: CTRL-SHIFT-D
  • Select line: Triple Click (works outside TM too)
  • Move selection: CTRL-CMD-Arrow
  • Comment/Uncomment: CMD-/

Also, for maximum productivity, don't forget to set your keyword repeat rate to its maximum or beyond.

gdelfino
A: 

For a list of most useful keyboard shortcuts for Rails development see my blog post: http://szeryf.wordpress.com/2010/02/15/textmate-shortcuts-you-should-be-using/

You might also want to check out this bundle: http://github.com/szeryf/rails-routes.tmbundle

szeryf