Relentlessly Shortcut: .bashrc & Thor

BY Doug Breaker

January 25, 2011

Check out the incredible shortcut Lance Armstrong takes in the above clip.

As developers, we should try to shortcut as smoothly as Lance does. You might not get cheered on quite as much—but then again, you have a lot more shortcut opportunities!

Shortcuts and Development Workflow

The quicker I can go from intent to action, the happier I am with my development workflow. Below are two tools I rely on to build shortcuts as effortlessly as possible.

An Organic, Evolving .bashrc

The best general-purpose shortcut mechanism is aliases in your .bashrc. I have one- and two-letter aliases for all my common working directories, git commands, server startups, etc.

If you want to relentlessly shortcut, you need a shortcut for creating shortcuts:

alias brc='vi ~/.bashrc;. ~/.bashrc'

All this does is load up .bashrc, and re-source it when I exit out of vi. This one command has turned my .bashrc into an organic, evolving toolbox, making whatever I’m working on easier, faster, and more fun.

Thor

For more involved scripting, I’ve recently become a fan of Thor. Thor is everything you like about Rake combined with everything you used to like about Sake:

Here is the hello world of Thor, and here is a more advanced article to get the juices flowing.

Previously in Developer Happiness

This is Part 3 in our Developer Happiness series. See previous articles:

Subscribe to our RSS feed or follow us on Twitter for the rest of the developer happiness series.