Switch to block cursor in cmd mode (iterm/mac only)

This commit is contained in:
Henrik Lissner 2013-08-04 02:54:02 -04:00
parent 021b9589b9
commit 730b0f3ca0

View file

@ -1,3 +1,28 @@
# Switch between block and line cursor (Only in iterm)
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
zle reset-prompt
zle -R
}
function zle-line-finish
{
print -n -- "\E]50;CursorShape=0\C-G" # block cursor
}
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
fi
# Disable autocorrect behavior, very annoying!
unsetopt correct_all