Switch to block cursor in cmd mode (iterm/mac only)
This commit is contained in:
parent
021b9589b9
commit
730b0f3ca0
25
zsh/config
25
zsh/config
|
@ -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!
|
# Disable autocorrect behavior, very annoying!
|
||||||
unsetopt correct_all
|
unsetopt correct_all
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue