diff options
Diffstat (limited to '04-options.zsh')
-rw-r--r-- | 04-options.zsh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/04-options.zsh b/04-options.zsh index 35b0a85..e22f3c8 100644 --- a/04-options.zsh +++ b/04-options.zsh @@ -5,3 +5,24 @@ zstyle ':completion:*' matcher-list '' \ 'm:{a-z\-}={A-Z\_}' \ 'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \ 'r:|?=** m:{a-z\-}={A-Z\_}' + +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +# Use beam shape cursor on startup. +echo -ne '\e[5 q' +_fix_cursor() { + echo -ne '\e[5 q' +} |