Merge pull request #125 from dawikur/allow_segment_reordering

Allow to specify custom prompt order

Closes #115
This commit is contained in:
Caio Gondim
2016-04-08 13:31:39 +02:00
3 changed files with 58 additions and 13 deletions

View File

@@ -97,6 +97,23 @@ zgen load caiogondim/bullet-train-oh-my-zsh-theme bullet-train
Bullet Train is configurable. You can change colors and which segments you want
or don't want to see. All options must be overridden in your **.zshrc** file.
### Order
`BULLETTRAIN_PROMPT_ORDER` defines order of prompt segments. Use zsh array
syntax to specify your own order, e.g:
```bash
BULLETTRAIN_PROMPT_ORDER=(
git
context
dir
time
)
```
NOTE: You do not need to specify *end* segment - it will be added automatically.
With this you can also specify custom segments, please see [Tips](#tips) for
more details.
### Prompt
|Variable|Default|Meaning
@@ -242,6 +259,24 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
## Tips
### BULLETTRAIN_PROMPT_ORDER
This gives ability to customize order and put user-defined segment on prompt.
```bash
prompt_say_hello() {
prompt_segment yellow blue "hello"
}
BULLETTRAIN_PROMPT_ORDER=(
git
dir
say_hello
)
```
![Prompt_Order](./img/tips/prompt_order.png)
### BULLETTRAIN_GIT_PROMPT_CMD
Allows you to specify custom git prompt command. This makes it possible to