I've created some custom key bindings for bash vi mode. They trigger while I'm in insert mode and I want them instead to trigger when I'm in normal mode.
I'm using vi mode
set -o vi
in a terminal emulator on Ubuntu 14.04 server. So far I have remapped:
^ — Move to start of line
$ — Move to end of line
To the following:
<space>
a — Move to start of line
<space>
; — Move to end of line
Using the bash built-in command bind by editing .bashrc as follows:
bind " -a":beginning-of-line
bind " -;":end-of-line
These key bindings work - but they only trigger when I'm in insert mode. How do I get them only to fire only when I'm in normal mode and not in insert mode, instead?
tags: bash vi mode, bash vi mode remap keys, vi mode normal mode
<space>a
is intended to send the cursor to the start of the line rather than a literal space followed by ana
?~/.inputrc
and you can then distinguish betweenvi-command
andvi-insert
.