mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 11:50:38 +01:00
Merge pull request #112 from dawikur/feature/git_prompt_tips
Add Tips section to README
This commit is contained in:
39
README.md
39
README.md
@@ -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:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
into:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
That project was originally a fork from
|
That project was originally a fork from
|
||||||
|
|||||||
BIN
img/tips/git_prompt_command.png
Normal file
BIN
img/tips/git_prompt_command.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
img/tips/git_prompt_function.png
Normal file
BIN
img/tips/git_prompt_function.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
img/tips/git_prompt_origin.png
Normal file
BIN
img/tips/git_prompt_origin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Reference in New Issue
Block a user