diff options
-rw-r--r-- | readme.md | 17 | ||||
-rw-r--r-- | src/vcs.rs | 2 |
2 files changed, 14 insertions, 5 deletions
@@ -1,6 +1,6 @@ | |||
1 | # pista | 1 | # pista |
2 | 2 | ||
3 | > a simple bash prompt for programmers | 3 | > a simple {bash, zsh} prompt for programmers |
4 | 4 | ||
5 | ![pista.png](https://files.nerdypepper.me/52.png) | 5 | ![pista.png](https://files.nerdypepper.me/52.png) |
6 | 6 | ||
@@ -22,12 +22,21 @@ http://rustup.rs and follow the instructions. | |||
22 | make sure to add `$HOME/.cargo/bin` to your `$PATH`! | 22 | make sure to add `$HOME/.cargo/bin` to your `$PATH`! |
23 | 23 | ||
24 | 24 | ||
25 | once you have installed `pista`, set your `PS1` to use it! | 25 | - bash users, set your `PS1`: |
26 | ```shell | 26 | ```shell |
27 | PS1="$(pista)" # regular variant | 27 | PS1="$(pista)" # regular variant |
28 | PS1="$(pista -m)" # minimal variant | 28 | PS1="$(pista -m)" # minimal variant |
29 | ``` | 29 | ``` |
30 | 30 | ||
31 | - zsh users, add this to your `.zshrc`: | ||
32 | ```shell | ||
33 | autoinit -Uz add-zsh-hook | ||
34 | _pista_prompt() { | ||
35 | PROMPT=$("pista") # `pista -m` for the miminal variant | ||
36 | } | ||
37 | add-zsh-hook precmd _pista_prompt | ||
38 | ``` | ||
39 | |||
31 | 40 | ||
32 | `pista` handles prompt modifications when you enter virtual environments. | 41 | `pista` handles prompt modifications when you enter virtual environments. |
33 | make sure to disable `virtualenv`'s changes. | 42 | make sure to disable `virtualenv`'s changes. |
@@ -39,8 +48,8 @@ thats it! read on if you aren't happy with the defaults. | |||
39 | 48 | ||
40 | ### configuration | 49 | ### configuration |
41 | 50 | ||
42 | this is the default configuration. drop this in your `.bashrc` to get started. | 51 | this is the default configuration. drop this in your `.bashrc` (or `.zshrc`) to get started. |
43 | remember to `source ~/.bashrc` to observe the changes! | 52 | remember to `source ~/.bashrc` (or `source ~/.zshrc`) to observe the changes! |
44 | 53 | ||
45 | ``` | 54 | ``` |
46 | # prompt string to display, for regular users | 55 | # prompt string to display, for regular users |
@@ -74,7 +74,7 @@ pub fn vcs_status() -> Option<(colored::ColoredString, colored::ColoredString)> | |||
74 | repo_stat = stat_char.color(&git_index_modified_color[..]); | 74 | repo_stat = stat_char.color(&git_index_modified_color[..]); |
75 | }, | 75 | }, |
76 | // STATE: committed (changes have been saved in the repo) | 76 | // STATE: committed (changes have been saved in the repo) |
77 | _ => { } | 77 | _ => {} |
78 | } | 78 | } |
79 | } | 79 | } |
80 | return Some((branch, repo_stat)) | 80 | return Some((branch, repo_stat)) |