diff --git a/.config/zsh/plugins/keys.zsh b/.config/zsh/plugins/keys.zsh index 6b2155d..579403e 100644 --- a/.config/zsh/plugins/keys.zsh +++ b/.config/zsh/plugins/keys.zsh @@ -6,16 +6,24 @@ # no delay when switching into NORMAL export KEYTIMEOUT=1 - # Switch cursor style depending on mode function zle-line-init zle-keymap-select { + # Switch cursor style depending on mode case $KEYMAP in vicmd) echo -ne "\e[1 q";; # block viins|main) echo -ne "\e[5 q";; # beam esac + + # Make sure that the terminal is in application mode when zle is active, since + # only then values from $terminfo are valid + echoti smkx } zle -N zle-line-init zle -N zle-keymap-select + # See above (echoti smkx) + function zle-line-finish { echoti rmkx; } + zle -N zle-line-finish + bindkey '^[h' run-help ## History ## Alternatives to check out: {up,down}-line-or-search