Document the limited vi editing mode
Author: krader1961Created Apr 17, 2020Updated Jul 14, 2025
Labelsdoc
Someone asked on IRC if Elvish supported vi mode editing. I couldn't find any mention in the documentation and grep'ing the source didn't return any promising results. It turns out that doing
edit:insert:binding[Ctrl-'['] = $edit:command:start~will enable a very limited vi editing mode. See also #730 for why the features are currently limited. The currently support vi commands can be found here: https://github.com/elves/elvish/blob/f30a2b6837a792727aa665a96229e1c0a1e71d91/edit/insert.go#L99
What's interesting about the current implementation is that it still leaves most (all?) of the emacs bindings in effect; e.g., [ctrl-A] moves to the start of the line in insert mode.
Source: elves/elvish