>bind -m vi-command '"ii": vi-insertion-mode'
>bind -m vi-insert '"ii": vi-movement-mode'
>Or the following should work (untested here) using $HOME/.inputrc:
> set keymap vi-command
> "ii": vi-insertion-mode
> set keymap vi-insert
> "ii": vi-movement-mode
I've just tested the above inputrc by executing a new bash shell instance and
the above inputrc statement works, but there is an undesirable effect when
While in insert mode, pressing the 'i' key only once causes readline to
intercept it and not print the 'i' char to screen if only pressed once. In
order to get the 'i' char printed, I need to immediately press any other key
following the 'i' char/key so it is not intercepted by readline as it is not a
double 'i' key (ie 'ii').
For example, I'm typing the imaginary command "sit" and accidently typed "st".
I go to history and then movement mode and try to insert just an 'i' and will
fail as readline is intercepting the single char and awaiting a secondary char
to determine if it's a double 'i' key press. I would need to type 'i' and then
right cursor to successfully fix the typing error.
(Or, to be lazy and humorous, I could just fix it to 'silt' preventing less