Tired of typing all those underscores_while_writing_your_BDD_specifications? Yeah, I wasn’t really either. However I’ve heard read complaints from some folks that typing the underscore so many times was getting annoying, so they had opted for PascalCasing instead.
Just deal with it
Maybe its because of my exposure to Ruby and the joy that is RSpec, but I don’t think such minor annoyance is enough of a reason to top using a more readable style. Repetitive Stress Injury, be damned!
Or maybe not! The other day while cleaning out my RSS reader I came across AutoHotKey (thanks JP), a utility that allows you to launch custom scripts, macros, etc… via keyboard shortcuts.
No more Ctrl + -
Thanks to some great work by JP, Aaron Jensen, and David Tchepak we have an AutoHotKey script that can automagically replace any space characters with an underscore, as you type, in real time.
You can toggle the script on and off using the Ctrl + Shift + U hot key, a.k.a – keyboard shortcut. The script is also smart enough to turn itself off when you hit either Enter or Escape keys. And Aaron even has a version of the script that is only active when Visual Studio is active. However, being that I use e-Text Editor as my Ruby IDE, I like having the script available everywhere in the OS.
Dave added a little more sugar by tweaking the script so it shows a custom icon in the Windows task tray when the script is running, or not. A nice touch to really round out the experience.
Get yourself some AHK!
The one thing I found a little confusing was how exactly to get the script up and running, with the icons. Luckily, you won’t have to struggle… I’ll lay it out for ya’. :)
- Get AutoHotKey – download and install it.
- Grab JP’s script – or Aaron’s modified one if want. Save the script as
some-name-here.ahk, wherever you want, I have mine in my Documents directory. - Pull down Dave’s icons – copy the two icon files to the same directory as your .ahk script from step 2.
- Launch your script!
Enjoy!
