mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
[Agnoster theme] Add the prompt view customization ability
This commit is contained in:
parent
3848102a5e
commit
1ab87862ff
1 changed files with 17 additions and 9 deletions
|
@ -29,6 +29,20 @@
|
||||||
# jobs are running in this shell will all be displayed automatically when
|
# jobs are running in this shell will all be displayed automatically when
|
||||||
# appropriate.
|
# 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
|
### Segment drawing
|
||||||
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
||||||
|
|
||||||
|
@ -239,15 +253,9 @@ prompt_aws() {
|
||||||
## Main prompt
|
## Main prompt
|
||||||
build_prompt() {
|
build_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_status
|
for prompt_segment in "${AGNOSTER_PROMPT[@]}"; do
|
||||||
prompt_virtualenv
|
[[ -n $prompt_segment ]] && $prompt_segment
|
||||||
prompt_aws
|
done
|
||||||
prompt_context
|
|
||||||
prompt_dir
|
|
||||||
prompt_git
|
|
||||||
prompt_bzr
|
|
||||||
prompt_hg
|
|
||||||
prompt_end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT='%{%f%b%k%}$(build_prompt) '
|
PROMPT='%{%f%b%k%}$(build_prompt) '
|
||||||
|
|
Loading…
Reference in a new issue