Skip to content

Commit

Permalink
Show alternate prompt character when in VICMD mode
Browse files Browse the repository at this point in the history
  • Loading branch information
molovo committed Jan 28, 2018
1 parent 565136c commit 16660ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions filthy.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ prompt_filthy_connection_info() {
fi
}

prompt_filthy_prompt_char() {
case $KEYMAP in
vicmd) echo "%(?.%F{blue}.%F{red}$(prompt_filthy_nice_exit_code))${PROMPT_FILTHY_VICMD_CHAR:-●}%f" ;;
*) echo "%(?.%F{green}.%F{red}$(prompt_filthy_nice_exit_code))${PROMPT_FILTHY_PROMPT_CHAR:-❯}%f" ;;
esac
}

prompt_filthy_setup() {
# prevent percentage showing up
# if output doesn't end with a newline
Expand All @@ -293,13 +300,12 @@ prompt_filthy_setup() {

zmodload zsh/datetime
autoload -Uz add-zsh-hook
# autoload -Uz git-info

add-zsh-hook precmd prompt_filthy_precmd
add-zsh-hook preexec prompt_filthy_preexec

# prompt turns red if the previous command didn't exit with 0
PROMPT='%(?.%F{green}.%F{red}$(prompt_filthy_nice_exit_code))❯%f '
PROMPT='$(prompt_filthy_prompt_char) '

RPROMPT='$(prompt_filthy_rprompt)'
}
Expand Down

0 comments on commit 16660ae

Please sign in to comment.