+function zle-line-init zle-keymap-select {
+ local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
+ RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}${return_status}%{$reset_color%}"
+ RPS2=$RPS1
+ zle reset-prompt
+}
+zle -N zle-line-init
+zle -N zle-keymap-select
+