53854754e0d052c41587c7d84b9be7868f31bfe8

Author
Max Bane <max.bane@gmail.com>
Committer
Max Bane <max.bane@gmail.com>
Date

Message

Revert "Fix to restore bindings after switching to vi-mode"

This reverts commit b609aa0e6c981f2039d777687cb01a84587f6edc -- this commit
was a bad idea, because it makes vi-mode very difficult to use. The default
`bindkey` keybindings are NOT MEANT to coexist with `bindkey -v` Vi mode;
that's why `bindkey -v` clears them in the first place! Restoring all of the
default keybindings after enabling Vi mode, the way the reverted commit did,
causes many collisions between those default keybindings that begin with ESC
and the command-mode-initiating ESC of Vi mode. See Issue 1438 of
robbyrussell/oh-my-zsh. If people have custom keybindings, they should create
them in their ~/.zshrc AFTER enabling the vi-mode plugin and sourcing
oh-my-zsh.sh.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   plugins/vi-mode/vi-mode.plugin.zsh
#

Diff

 1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 2index d29eb1dda85de0b8aa9416643166c5f4081d468b..c47ab72114562251e4ca75f1395dcaea1abe2002 100644
 3--- a/plugins/vi-mode/vi-mode.plugin.zsh
 4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 5@@ -5,12 +5,7 @@ function zle-line-init zle-keymap-select {
 6 zle -N zle-line-init
 7 zle -N zle-keymap-select
 8 
 9-#changing mode clobbers the keybinds, so store the keybinds before and execute 
10-#them after
11-binds=`bindkey -L`
12 bindkey -v
13-for bind in ${(@f)binds}; do eval $bind; done
14-unset binds
15 
16 # if mode indicator wasn't setup by theme, define default
17 if [[ "$MODE_INDICATOR" == "" ]]; then