zsh: change cursor based on mode
This commit is contained in:
parent
e0d1f648f8
commit
0227e42135
|
@ -165,3 +165,4 @@ prompt_tastytea_setup "$@"
|
|||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# End:
|
||||
# vim: set ft=zsh:
|
||||
|
|
|
@ -41,8 +41,24 @@ function zle-line-finish () {
|
|||
echoti smkx
|
||||
fi
|
||||
}
|
||||
|
||||
# Change cursor based on mode
|
||||
print -n '\e[6 q'
|
||||
function zle-keymap-select() {
|
||||
if [[ "${KEYMAP}" == "viins" || "${KEYMAP}" == "main" ]]; then
|
||||
print -n '\e[6 q' # beam
|
||||
else
|
||||
print -n '\e[2 q' # block
|
||||
fi
|
||||
}
|
||||
function _fixcursor() {
|
||||
print -n '\e[6 q'
|
||||
}
|
||||
add-zsh-hook precmd _fixcursor
|
||||
|
||||
zle -N zle-line-init
|
||||
zle -N zle-line-finish
|
||||
zle -N zle-keymap-select
|
||||
zle -N history-substring-search-up
|
||||
zle -N history-substring-search-down
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user