Skip to content

Commit

Permalink
[Agnoster theme] Add the prompt view customization ability
Browse files Browse the repository at this point in the history
  • Loading branch information
apodkutin committed Oct 7, 2019
1 parent 3848102 commit 1ab8786
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions themes/agnoster.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@
# jobs are running in this shell will all be displayed automatically when
# appropriate.

### Segments of the prompt default order declaration

typeset -aHg AGNOSTER_PROMPT=(
prompt_status
prompt_virtualenv
prompt_aws
prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_end
)

### Segment drawing
# A few utility functions to make it easy and re-usable to draw segmented prompts

Expand Down Expand Up @@ -239,15 +253,9 @@ prompt_aws() {
## Main prompt
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_aws
prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_end
for prompt_segment in "${AGNOSTER_PROMPT[@]}"; do
[[ -n $prompt_segment ]] && $prompt_segment
done
}

PROMPT='%{%f%b%k%}$(build_prompt) '

0 comments on commit 1ab8786

Please sign in to comment.