-
Notifications
You must be signed in to change notification settings - Fork 382
Tips
Caio Gondim edited this page Aug 6, 2016
·
4 revisions
This gives ability to customize order and put user-defined segment on prompt.
prompt_say_hello() {
prompt_segment yellow blue "hello"
}
BULLETTRAIN_PROMPT_ORDER=(
git
dir
say_hello
)
Allows you to specify custom git prompt command. This makes it possible to change:
into:
with:
BULLETTRAIN_GIT_PROMPT_CMD=\${\$(git_prompt_info)//\\//\ \ }
Please note we need to delay variable expansion, so we have to escape all weird character - $, **, <space>, etc.
You can also use function to get more complex commands:
BULLETTRAIN_GIT_PROMPT_CMD="\$(custom_git_prompt)"
custom_git_prompt() {
prompt=$(git_prompt_info)
prompt=${prompt//\//\ \ }
prompt=${prompt//_/\ }
echo ${prompt}
}
which gives: