ZSH: Don't invoke vi-mode in emacs shell

This commit is contained in:
Henrik Lissner 2014-07-21 03:08:01 -04:00
parent c1d7982c61
commit 1f6ee00a75

View file

@ -50,28 +50,31 @@ bindkey '^r' history-incremental-search-backward
bindkey '^w' backward-kill-word bindkey '^w' backward-kill-word
bindkey '^a' beginning-of-line bindkey '^a' beginning-of-line
bindkey '^e' end-of-line bindkey '^e' end-of-line
bindkey ${terminfo[kdch1]} delete-char
# Switch between block and line cursor (Only in iterm) if ! [ "$EMACS" ]; then
if is_mac; then bindkey ${terminfo[kdch1]} delete-char
function zle-keymap-select zle-line-init {
# change cursor shape in iTerm2
case $KEYMAP in
vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor
viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor
esac
zle reset-prompt # Switch between block and line cursor (Only in iterm)
zle -R if is_mac; then
} function zle-keymap-select zle-line-init {
# change cursor shape in iTerm2
case $KEYMAP in
vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor
viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor
esac
function zle-line-finish { zle reset-prompt
print -n -- "\E]50;CursorShape=0\C-G" # block cursor zle -R
} }
zle -N zle-line-init function zle-line-finish {
zle -N zle-line-finish print -n -- "\E]50;CursorShape=0\C-G" # block cursor
zle -N zle-keymap-select }
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
fi
fi fi
# Switch between block and line cursor (Only in iterm) # Switch between block and line cursor (Only in iterm)