ruby-on-railsviirbrails-consolebash

how to do vi style navigation in rail console


How can I do VI style navigation in rails console?

In my .bash_profile i do set -o vi and then in my terminals I enjoy vi style navigation. I can do dd to delete a line, cmd+$ to jump to end of line, etc etc.

I want to get the same thing in rails console?


Solution

  • You need to set the editing-mode to vi. The easiest way to do that is simply creating the file .inputrc in your home folder and add the mode:

    $ echo "set editing-mode vi" >> ~/.inputrc

    And voilá!