Skip to content
Caio Gondim edited this page Aug 6, 2016 · 4 revisions

BULLETTRAIN_PROMPT_ORDER

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
)

Prompt_Order

BULLETTRAIN_GIT_PROMPT_CMD

Allows you to specify custom git prompt command. This makes it possible to change:

Git_Prompt_Origin

into:

Git_Prompt_Command

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:

Git_Prompt_Function

Clone this wiki locally