What does "vi-move" keymap in Bash's vi mode actually do?

0

The keymap section in the Bash Reference Manual says that one of the acceptable options is "vi-move". There doesn't seem to be any description for what this corresponds to. I'm well acquainted with "vi-command" and "vi-insert", but can't seem to find anything regarding "vi-move".

I had hoped that this question would shed some light on things, but no such luck.

Pak

Posted 2014-02-18T02:42:51.970

Reputation: 379

Answers

1

diff <(bind -p -m vi-move) <(bind -p -m vi-command) shows no difference, so I guess they are just synonyms. Nevertheless, the readline documentation only states that vi and vi-command are equivalent and, despite it mentions vi-mode in the same paragraph, it fails to assert the equivalence between the three modes. So, I have asked Chet Ramey and his authoritative answer was "yes [the three are the same]".

memeplex

Posted 2014-02-18T02:42:51.970

Reputation: 141

0

vi-move, vi-command and vi are synonyms for one and the same keymap (as proven by @memeplex), and is the one set active by the vi-movement-mode command.

The vi-insert keymap is set active by the editing-mode vi command, or set -o vi.

Note that in bash v4.3.11(1), executing the vi-movement-mode command when the emacs keymap is active doesn't change the prompt if show-mode-in-prompt is on, but changing to vi-editing-mode does. The work-around is here.

Tom Hale

Posted 2014-02-18T02:42:51.970

Reputation: 1 348

0

Searching through the bash manual locally, the string "vi-move" shows up in the VI Mode bindings section:

VI Mode bindings
         VI Insert Mode functions

         "C-D"  vi-eof-maybe
         ... <snip>
         "C-["  vi-movement-mode
         ...

In vim doing :help ^[ shows this:

                                            i_CTRL-[ i_<Esc>                                                                                              
<Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode.  Finish
            abbreviation. 
            Note: If your <Esc> key is hard to hit on your keyboard, train
            yourself to use CTRL-[.

This is just the transition key to go from Insert mode to Normal mode, so I think vi-move is basically "Normal" mode in vim. I'm not sure how that maps to something useful in Bash, though. My keymap shows either vi or vi-insert depending on whether I invoke bash -V by typing it or by hitting Esc k CR to replay from history.

David Pope

Posted 2014-02-18T02:42:51.970

Reputation: 126