1
0
Fork 0
mirror of synced 2024-11-16 04:55:35 -05:00

Implement keymode indicator

This commit is contained in:
Colin Jamison 2017-01-21 18:00:14 +01:00
parent 2c0cc6fbd7
commit 2a1a3cd45a
4 changed files with 31 additions and 3 deletions

View file

@ -141,6 +141,12 @@ prompt_eriner_main() {
prompt_eriner_precmd() {
vcs_info
PROMPT='%{%f%b%k%}$(prompt_eriner_main) '
RPROMPT="${${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
zle -N zle-keymap-select
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes false

View file

@ -15,6 +15,12 @@ prompt_gitster_get_pwd() {
prompt_gitster_precmd() {
[[ ${+functions[git-info]} ]] && git-info
RPROMPT="${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}"
}
zle-keymap-select() {
prompt_gitster_precmd
zle reset-prompt
}
prompt_gitster_setup() {
@ -24,6 +30,8 @@ prompt_gitster_setup() {
prompt_opts=(cr percent subst)
add-zsh-hook precmd prompt_gitster_precmd
zle -N zle-keymap-select
zstyle ':zim:git-info:branch' format '%b'
zstyle ':zim:git-info:commit' format '%c'

View file

@ -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="${${KEYMAP/vicmd/[NORMAL]}/(main|viins)/}"
}
zle-keymap-select() {
prompt_magicmace_precmd
zle reset-prompt
}
prompt_magicmace_setup() {
@ -63,8 +70,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 "$@"

View file

@ -40,11 +40,17 @@ prompt_steeef_precmd() {
vcs_info 'prompt'
fi
RPROMPT="${${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
zle -N zle-keymap-select
prompt_opts=(cr subst percent)
}