SBoudrias/Inquirer.js — pull request #80 by tklun (2013-11-02 17:38:12+00:00)
Title: Adds support for vi-style navigation.

I decided I'd add this feature while using Yeoman, which includes Inquirer.js as a dependency of a dependency. I think this feature is really nice as it allows you to navigate through Inquirer.js lists and checkboxes without having to move your hands from the home row. I think this would be a really nice feature, especially for Vi(m) users to whom this style of navigation is familiar. I added this functionality to the checkbox and list JavaScript as they seem to be the only prompts that allow for arrow navigation.

Adding new conditions to the if statements resulted in some very long lines. Rather than messing with strange line breaks for the sake of formatting, I decided to use Lodash and a whitelist array approach. I've added tests to support this new functionality. I also renamed one of the previous tests just to keep the navigation test names consistent.

If you prefer a different approach I'd be happy to refactor this. I didn't feel the need to mess with the "Use arrow keys" text. Users who are familiar with this type of navigation will likely try to navigate with `j` and `k` anyway and hopefully be pleasantly surprised.