]>
git.rmz.io Git - dotfiles.git/blob - zsh/plugins/vi-mode/vi-mode.plugin.zsh
f91be70e4c5316856b93f7a18134a3e62b66aabc
1 # Ensures that $terminfo values are valid and updates editor information when
3 function zle
-keymap-select zle
-line-init zle
-line-finish {
4 # The terminal must be in application mode when ZLE is active for $terminfo
6 if (( $
+terminfo
[smkx
] && $
+terminfo
[rmkx
] )); then
9 # Enable terminal application mode.
13 # Disable terminal application mode.
23 zle
-N zle
-line-finish
24 zle
-N zle
-keymap-select
28 # if mode indicator wasn't setup by theme, define default
29 if [[ "$MODE_INDICATOR" == "" ]]; then
30 MODE_INDICATOR
="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
33 function vi_mode_prompt_info
() {
34 echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
37 # define right prompt, if it wasn't defined by a theme
38 if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
39 RPS1
='$(vi_mode_prompt_info)'