TextMate Tip #1 (Hashes)

I get disappointed when people don’t make an effort to learn their tool set.  I am guilty of this as I used to be a hard core emacs user, but when I moved from GNU\Linux to Mac OSX, I migrated to Textmate and stopped programming full time.  I never took the time to learn the new editor.  Having paired a lot lately with our interns I feel I am doing them a dis-service by not giving them a full arsenal of tricks in their primary weapon “the editor”.  Mountain West Ruby Conference inspired me to do something about it, well actually the RV Trip there and back.

So, I am going to try and do a Textmate Tip/Trick of the week (or maybe day).  Many of these items will be new to me as well, so if I mess it up or miss something cool, please let me know.  If you find them valuable also let me know.  Here is the first installation.


Text Mate Tip of the Day (Hashes) Episode 1 from Derek Neighbors on Vimeo.

This entry was posted in Agile, Community, Integrum, Textmate. Bookmark the permalink.

12 Responses to TextMate Tip #1 (Hashes)

  1. Ben Atkin says:

    This sounds like it will be a great teaching tool. The first video was short and instructive. I use vim, but this video was useful because it reminded me that I need to figure out how snippets work in vim, and gave me the idea to add a shortcut for the hash rocket string.

  2. Patrick says:

    Hi Derek,

    I really like the idea. Will all tips be presented as a screencast?

    Greetings and keep up the good work.

  3. Patrick,

    I plan to do all the tips as screencasts. The goal is to keep them under 2 minutes. Bite size. I also plan on doing BASH (shell) tips of the day as well. As always I have even a bigger master plan than that, but figured we would start here.

    -
    Derek

  4. Pingback: TextMate Screencasts for Rubyists

  5. Great quick tutorial. I’ve been using TextMate for long time now but I haven’t taken the time to learn all the magic it can do. Keep it coming!

    Here is a shortcut that saves me a lot time:
    c)+

    This outputs a copyright notice, which I have customized to my needs.

  6. I’m really thrown by your last Hash example. What exactly is:

    Hash.new {|format.xml, xml| format.xml[xml] = @post}

    doing?

    From what I understand, Hash.new {|hash, key| …} allows you to create a Hash with a custom default value. But then having format.xml as a block parameter results in format.xml getting set to the hash you created..? It seems to be equivalent to:

    h = Hash.new do |hash, key|
    format.xml = h
    format.xml[key] = @post
    end

    Is that right? What does that end up doing exactly?

  7. Jay McGavren says:

    I learned the Control-L shortcut to type a hashrocket (=>), then switched back to the manual way when I found myself trying (and failing) to type Control-L in the Console. Choose your habituations wisely.

  8. My main argument is why are you programming from the console? It should be in frequent enough that your editor habits shouldn’t be too cumbersome. Though I admit when I am in console I swear a lot more. :)

  9. Jordan, I definitely am not a Ruby master and Im doing the tips in about 10 minutes or less with no planning. So, definitely there is a good chance the ruby syntax will be wrong. FWIW i think your assessment of the code is correct.

  10. Tim Rand says:

    Hey Derek,
    Good stuff. I will be following your blog. Thanks for posting.

  11. Pingback: Screencasts de Textmate para Rubistas

  12. Glen Barnes says:

    These look really good. I started down the same track a while ago but ended but being to busy doing other things as usual. I managed 4 video’s which can be found here.

    Hope you can keep it going for longer than I did!

    Glen

Comments are closed.