Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are these two vi-related `.inputrc` lines redundant?

Tags:

bash

vi

I've seen people recommend putting both of the following lines in one's .inputrc to enable vi key-mappings:

set editing-mode vi
set keymap vi

Sometimes, they are recommended separately; sometimes, they are recommended together. Gah! Are both necessary on any systems?


As a greedy side note, if either of those are included in one's .inputrc, is it still necessary to include:

set -o vi

...in one's .bash_profile?

like image 709
ClosureCowboy Avatar asked Aug 25 '11 06:08

ClosureCowboy


2 Answers

The file /etc/inputrc or ~/.inputrc controls the library readline. Readline is used by many many programs (including bash).

The second one, set -o vi controls only bash. vimrc has no effect on bash.

like image 158
cnicutar Avatar answered Sep 20 '22 03:09

cnicutar


Only the first line is necessary:

set editing-mode vi

The second line defines how future manual key mappings will be applied:

set keymap vi
like image 22
ClosureCowboy Avatar answered Sep 18 '22 03:09

ClosureCowboy