a simple {bash, zsh} prompt for programmers
shell
$ cargo install pista
cargo is rust's package manager. if you dont have cargo installed, head over to
http://rustup.rs and follow the instructions.
make sure to add $HOME/.cargo/bin
to your $PATH
!
bash users, set your PS1
:
shell
PS1="$(pista)" # regular variant
PS1="$(pista -m)" # minimal variant
zsh users, add this to your .zshrc
:
shell
autoinit -Uz add-zsh-hook
_pista_prompt() {
PROMPT="$(pista -z)" # `pista -zm` for the miminal variant
}
add-zsh-hook precmd _pista_prompt
pista
handles prompt modifications when you enter virtual environments.
make sure to disable virtualenv
's changes.
shell
export VIRTUAL_ENV_DISABLE_PROMPT=1
thats it! read on if you aren't happy with the defaults.
this is the default configuration. drop this in your .bashrc
(or .zshrc
) to get started.
remember to source ~/.bashrc
(or source ~/.zshrc
) to observe the changes!
```
export PROMPTCHAR="$" export PROMPTCHAR_COLOR="green"
export PROMPTCHARROOT="#" export PROMPTCHARROOT_COLOR="red"
/home/nerdypepper/code
is shortened to/h/n/code
export SHORTENCWD=1 export CWDCOLOR="white"
/home/nerdypepper
is shortened to ~
export EXPAND_TILDE=0
export GITCLEAN="·" export GITCLEAN_COLOR="green"
export GITWTMODIFIED="×" export GITWTMODIFIED_COLOR="red"
export GITINDEXMODIFIED="±" export GITINDEXMODIFIED_COLOR="yellow"
export BRANCH_COLOR="green"
export COMMIT_COLOR="green" ```
all 16 colors are available: ``` black red green yellow blue magenta (or purple) cyan white
bright black bright red bright green bright yellow bright blue bright magenta (or purple) bright cyan bright white ```