Content License

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

 
Home Content Vim mode for the readline

Vim mode for the readline

Posted by tibi at Apr 07, 2010 04:29 PM |

I admit it, I'm clueless when it comes to bash editing. I know very few tricks with it: <C-r> for search in history, <C-u> to erase the current command line, but besides this, nothing.

But that will change from now on: I've configured my ~/.inputrc to have a vi mode as default, so now I can use most of my vim knowledge to navigate long command lines. Even better, I can hit Esc-v to enter "visual mode", aka vim. This and more is explained on this blog post

# Be 8 bit clean.
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off

# mode in everything that uses readline
set editing-mode vi
set keymap vi
Document Actions