Reputation: 404
In zsh, with emacs key mapping mode, Control + _ will cancel a completion.
Example:
echo $EDITOR[tab]
will be completed as:
echo vim
Pressing Control + _ will restore the editor to:
echo $EDITOR
I want to do the same thing with vi key mapping mode. Is there a way to do it? Is there already a key mapping to do it? Control + _ does not work neither in insert mode nor in normal mode.
The u (undo) will remove the entire line.
Upvotes: 0
Views: 287
Reputation: 404
I finally found how to do it.
bindkey -l will print a list of existing keymap names.
bindkey -M <keymap> will list all bindings for a given keymap.
So I compared emacs and viins bindings and added the following line:
bindkey -M viins "$key_info[Control]_" undo
to the .zprezto/modules/editor/init.zsh
. And it works.
I made a pull request to add this mapping to prezto: https://github.com/sorin-ionescu/prezto/pull/1860
Upvotes: 0