diff --git a/modules/prompt/themes/eriner.zsh-theme b/modules/prompt/themes/eriner.zsh-theme index 134a81c..b67e286 100644 --- a/modules/prompt/themes/eriner.zsh-theme +++ b/modules/prompt/themes/eriner.zsh-theme @@ -141,6 +141,12 @@ prompt_eriner_main() { prompt_eriner_precmd() { vcs_info PROMPT='%{%f%b%k%}$(prompt_eriner_main) ' + RPROMPT="${ZIM_PROMPT_INSERTMODE:+${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}}" +} + +zle-keymap-slect() { + prompt_eriner_precmd + zle reset-prompt } prompt_eriner_setup() { @@ -149,7 +155,9 @@ prompt_eriner_setup() { prompt_opts=(cr subst percent) - add-zsh-hook precmd prompt_eriner_precmd + add-zsh-hook prompt_eriner_precmd + + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' check-for-changes false diff --git a/modules/prompt/themes/gitster.zsh-theme b/modules/prompt/themes/gitster.zsh-theme index e7eacb7..4a1086a 100644 --- a/modules/prompt/themes/gitster.zsh-theme +++ b/modules/prompt/themes/gitster.zsh-theme @@ -15,6 +15,13 @@ prompt_gitster_get_pwd() { prompt_gitster_precmd() { [[ ${+functions[git-info]} ]] && git-info + PROMPT='$(prompt_gitster_get_status)%F{white}$(prompt_gitster_get_pwd)${(e)git_info[prompt]}%f ' + RPROMPT="${ZIM_PROMPT_INSERTMODE:+${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}}" +} + +zle-keymap-select() { + prompt_gitster_precmd + zle reset-prompt } prompt_gitster_setup() { @@ -24,6 +31,8 @@ prompt_gitster_setup() { prompt_opts=(cr percent subst) add-zsh-hook precmd prompt_gitster_precmd + + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select zstyle ':zim:git-info:branch' format '%b' zstyle ':zim:git-info:commit' format '%c' @@ -31,9 +40,6 @@ prompt_gitster_setup() { zstyle ':zim:git-info:dirty' format '%F{yellow}✗' zstyle ':zim:git-info:keys' format \ 'prompt' ' %F{cyan}%b%c %C%D' - - PROMPT='$(prompt_gitster_get_status)%F{white}$(prompt_gitster_get_pwd)${(e)git_info[prompt]}%f ' - RPROMPT='' } prompt_gitster_setup "$@" diff --git a/modules/prompt/themes/magicmace.zsh-theme b/modules/prompt/themes/magicmace.zsh-theme index bce1a87..426cf90 100644 --- a/modules/prompt/themes/magicmace.zsh-theme +++ b/modules/prompt/themes/magicmace.zsh-theme @@ -44,6 +44,13 @@ prompt_magicmace_precmd() { if [[ ${+functions[git-info]} ]]; then git-info fi + PROMPT='${COLOR_USER_LEVEL}$(prompt_magicmace_status)[${COLOR_NORMAL}$(short_pwd)${COLOR_USER_LEVEL}]${(e)git_info[prompt]}── ─%f ' + RPROMPT="${ZIM_PROMPT_INSERTMODE:+${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}}" +} + +zle-keymap-select() { + prompt_magicmace_precmd + zle reset-prompt } prompt_magicmace_setup() { @@ -54,6 +61,8 @@ prompt_magicmace_setup() { add-zsh-hook precmd prompt_magicmace_precmd + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select + zstyle ':zim:git-info:branch' format '%b' zstyle ':zim:git-info:commit' format '%c...' zstyle ':zim:git-info:dirty' format '*' @@ -63,8 +72,6 @@ prompt_magicmace_setup() { 'prompt' '─[${COLOR_NORMAL}%b%c%D%A%B${COLOR_USER_LEVEL}]' # Call git directly, ignoring aliases under the same name. - PROMPT='${COLOR_USER_LEVEL}$(prompt_magicmace_status)[${COLOR_NORMAL}$(short_pwd)${COLOR_USER_LEVEL}]${(e)git_info[prompt]}── ─%f ' - RPROMPT='' } prompt_magicmace_setup "$@" diff --git a/modules/prompt/themes/steeef.zsh-theme b/modules/prompt/themes/steeef.zsh-theme index 0d44159..d711499 100644 --- a/modules/prompt/themes/steeef.zsh-theme +++ b/modules/prompt/themes/steeef.zsh-theme @@ -40,11 +40,17 @@ prompt_steeef_precmd() { vcs_info 'prompt' fi + RPROMPT="${ZIM_PROMPT_INSERTMODE:+${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}}" PROMPT=' %{$purple%}%n${${reset_color}%} at %{$orange%}%m${${reset_color}%} in %{$limegreen%}%~${${reset_color}%} $vcs_info_msg_0_$(virtualenv_info)%{${reset_color}%} %(!.#.$) ' } +zle-keymap-select() { + prompt_steeef_precmd + zle reset-prompt +} + prompt_steeef_setup() { #use extended color pallete if available if [[ ${TERM} == *256* || ${TERM} == *rxvt* ]]; then @@ -96,6 +102,7 @@ prompt_steeef_setup() { add-zsh-hook preexec steeef_preexec add-zsh-hook chpwd steeef_chpwd add-zsh-hook precmd prompt_steeef_precmd + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select prompt_opts=(cr subst percent) }