bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash readline remap ESC insert/command mode key


From: Roger
Subject: Re: Bash readline remap ESC insert/command mode key
Date: Wed, 18 Jan 2012 22:12:54 -0900
User-agent: Mutt/1.5.21 (2010-09-15)

> On Wed, Jan 18, 2012 at 09:58:18PM -0900, Roger wrote:
>I use vi mode for Bash's realine and want to remap the ESC key to double 'ii' 
>and ';;' instead of having to remove my hands from the keyboard to tap the ESC 
>key.
>
>From what I see, I would be using something similar to:
>
>$ bind -m vi-command '"ii": <toggle insert/command mode command>'
>
>
>Second issue, I'm not sure of the command to use for toggling insert/command 
>mode. (ie. bind -l)  I think the two commands are vi-insertion-mode and 
>vi-movement-mode.
>
>
>I do know double key taps works such as the 'dd' key press sequence to delete 
>a 
>line, but only while in vi-movement mode or AKA command mode.
>
>
>Any ideas?  I'm all Googled-out over this one.


Ah. A new Google search got me a solution.

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:

$if mode=vi

    set keymap vi-command
    "ii": vi-insertion-mode

    set keymap vi-insert
    "ii": vi-movement-mode

$endif


-- 
Roger
http://rogerx.freeshell.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]