Struggle with Python and IRB shell going into vi edit mode

I am certainly a fan of “vi” editor.  No doubts!  However, when it comes to working with interactive shells of ruby(irb) and python, I prefer not using “vi” mode.  I somehow feel that I loose the coolness of scripting and quickly testing my code.

Obviously since all these interactive shells depend on “readline” library behind the scenes, I thought it should be simple configuration to switch of “vi editing mode”.

Went to “~/.inputrc” and found that the editing-mode was set to “vi” mode as below
set -o vi
set editing-mode vi

I simply commented out the above two lines and now got my “irb” working fine.  However, python would still not respect the above change and continue to be in “vi edit mode”.

On further googling and not finding any useful hints in the first 3 pages of Google Search Results told me that something is really weird.

Later, I did find some page talking about another configuration file used by Python shell and the file is “~/.editrc”

You will find a line “bind -v”.  Simply commenting this took care of my problem that existed for 2 months 🙂

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s