Merge pull request #112 from dawikur/feature/git_prompt_tips

Add Tips section to README
This commit is contained in:
Caio Gondim
2016-02-17 23:13:06 +01:00
4 changed files with 39 additions and 0 deletions

View File

@@ -239,6 +239,45 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|`BULLETTRAIN_EXEC_TIME_BG`|`yellow`|Background color |`BULLETTRAIN_EXEC_TIME_BG`|`yellow`|Background color
|`BULLETTRAIN_EXEC_TIME_FG`|`black`|Foreground color |`BULLETTRAIN_EXEC_TIME_FG`|`black`|Foreground color
## Tips
### BULLETTRAIN_GIT_PROMPT_CMD
Allows you to specify custom git prompt command. This makes it possible to
change:
![Git_Prompt_Origin](./img/tips/git_prompt_origin.png)
into:
![Git_Prompt_Command](./img/tips/git_prompt_command.png)
with:
``` bash
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:
``` bash
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](./img/tips/git_prompt_function.png)
## Contributors ## Contributors
That project was originally a fork from That project was originally a fork from

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB