:jasonrudolph => :blog

puts Blog.new(”nonsense”)

TextMate Oldie But Goodie Wrap-up

Posted by Jason Rudolph on 2nd December 2008

With November behind us, there’s now a month of TextMate productivity tips scattered across the twitterverse. In case you missed any of them, here’s a recap:

  • November 1 - Use Control+Option+Command+V to view your clipboard history. Then hit Enter to paste the selected item into the current document.
  • November 2 - Use Control+Shift+C to access the Math bundle from any file. Instantly perform calculations, add/subtract selected numbers, and more.
  • November 3 - With your cursor on any Ruby string, use Control+Shift+' to toggle between single quotes, double quotes, and %Q{}. Also works with Groovy, JavaScript, Perl, SQL, Bash, etc.
  • November 4 - In HTML (or HTML-friendly) files, select several lines and use Control+Command+Shift+W to wrap each line in a pair of HTML tags.
  • November 5 - Control+Escape brings up the automation menu. Use it for quick access to the current bundle and to navigate through other bundles.
  • November 6 - With your cursor on any Ruby symbol, use Control+: to change it to a string. Use Control+: again to toggle back to a symbol.
  • November 7 - Folding is (almost always) evil and is triggered by accident more often than not. Turn it off in View -> Gutter -> Foldings.
  • November 8 - For the rare occasion when you want folding, use F1 to fold the current block. Use Command+Option+n (where n is a digit) to toggle foldings at the nth level.
  • November 9 - With your cursor on a misspelled word, use Option+F2 to bring up suggested spelling corrections. Hit Enter to choose a correction.
  • November 10 - With your cursor on any ActiveRecord model, use Control+Command+Shift+S to instantly view the schema for that model.
  • November 11 - When working w/ CSS, use Command+Shift+C to bring up the OS X color palette. Choose a color to insert the corresponding hex code.
  • November 12 - Selection-fu => Use Control+W to select the current word. Use Command+Shift+L to select the current line.
  • November 13 - Use Control+H to pull up the documentation for the selected word. Works for CSS attributes, Ruby methods, HTML tags, Javadoc, etc.
  • November 14 - Anywhere that ERb is supported, use Control+> to produce a <%= %> sequence. Hit it again to cycle through the various flavors.
  • November 15 - Need fast access to placeholder text? Type “lorem” and hit Tab.
  • November 16 - Sometimes TextMate is too smart for its own good. Use Control+Command+V to paste without reindent. Especially useful for YAML.
  • November 17 - Fun with case conversions - Control+U => TO UPPERCASE. Control+Shift+U => to lowercase. Control+Option+U => Convert to Titlecase.
  • November 18 - Use Control+Tab to toggle focus between the editor window and the folder/file tree in the project drawer.
  • November 19 - Don’t lose time waiting for “Find in Project” to slog through a large project. Search fast w/ Ack in Project.
  • November 20 - Use Control+Option+Command+P to preview the current file as rendered HTML. Good for HTML (duh), Markdown, and Textile.
  • November 21 - Command+Option+[ => Format current selection (or current line if nothing is selected) according to rules for the current grammar.
  • November 22 - Use Option+PageUp and Option+PageDown to page up/down while keeping your cursor in the middle of the screen. (On a laptop, PageUp is Function+Up. So, for this tip, you’d use Function+Option+Up and Function+Option+Down.)
  • November 23 - Use Command+Option+W to toggle soft line wrapping.
  • November 24 - Hit Escape to auto-complete the current word using similar words in the current file (in order of their proximity to the cursor).
  • November 25 - Enable “Edit in TextMate” to use TextMate from any Cocoa app - email in Mail.app, blog comments & wikis in Safari, etc.
  • November 26 - Use Option+Command+R to feed the current file (or selection) to any shell command and capture the output in any number of ways.
  • November 27 - Use Control+Option+Shift+H to change the language of the current file to HTML. Use ‘X’ for XML or XSL. ‘R’ for Ruby, Rails, etc.
  • November 28 - Command+Shift+T => Go to symbol. This grammar-sensitive fuzzy finder locates classes & methods in Ruby, IDs in HTML, etc.
  • November 29 - Hold down the Option key while selecting an area of text to make a columnar selection. More info here http://bit.ly/tmcol.
  • November 30 - Forgot how to access a certain feature of TextMate. Quickly find any and all of the TMOBGOTD tips (and more) with Command+Shift+?

And if you’re still following along, you’re hardcore enough that you’ll want to make sure that the bonus inaugural entry is firmly tucked into your TextMate black belt as well:

  • October 31 - Control+Command+T => Fuzzy find for bundle items.

Got a favorite TextMate tip of your own to share? Tag it with the worst acronym ever (TMOBGOTD - TextMate Oldie But Goodie Of The Day) for all the TextMate-lovin’ world to see.

Tags: , | No Comments »

A Month of TextMate Productivity Tips

Posted by Jason Rudolph on 4th November 2008

I’ve had the joy of calling TextMate my editor of choice for almost three years now, and as the The Pragmatic Programmer wisely recommends, my editor has definitely grown to become “an extension of [my] hand.” Often when giving a presentation or pair programming, someone will stop me to ask, “Wait a minute. How’d you do that?” “That” is inevitably in reference to some bit of hyper-productive TextMate keyboard wizardry that eliminated several steps the person was otherwise expecting to see. Of course, a few years ago you were more likely to hear me asking that question. (And I still love it when I get to ask that question nowadays.)

For the month of November, I’ll share one of these “How’d you do that?” tips each day. They’re by no means revolutionary; they’re much more in the oldie but goodie camp. Hence the name: TextMate Oldie But Goodie Of The Day (TMOBGOTD). Each one can shave time - sometimes several seconds - off of common tasks. And if they’re common tasks in your workflow, then that time surely adds up.

You can follow along at twitter.com/jasonrudolph, where the first four tips are already in place.

  1. November 1 - Use Control+Option+Command+V to view your clipboard history. Then hit Enter to paste the selected item into the current document.
  2. November 2 - Use Control+Shift+C to access the Math bundle from any file. Instantly perform calculations, add/subtract selected numbers, and more.
  3. November 3 - With your cursor on any Ruby string, use Control+Shift+' to toggle between single quotes, double quotes, and %Q{}. Also works with Groovy, JavaScript, Perl, SQL, Bash, etc.
  4. November 4 - In HTML (or HTML-friendly) files, select several lines and use Control+Command+Shift+W to wrap each line in a pair of HTML tags.

Whether you’re seeing these techniques for the first time or rediscovering a command that you’d forgotten about, take a moment to try it out. Perform each technique three times, and you’ll be well on your way to committing it to memory. In just 60 seconds a day, you too can train to become a TextMate black belt. Or double your money back. Guaranteed.

Update 2008-12-02 - Check out the full list of tips in the wrap-up post.

Tags: , | No Comments »

Noteworthy Nonsense - July 25, 2008

Posted by Jason Rudolph on 25th July 2008

Tags: , , , , | No Comments »