Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Contribution: prompt leah2


I recently helped a new user to get on zsh, and wanted to show them
the prompt framework to get a nice configuration quickly...
unfortunately most of the prompts there are either utterly bloated or
don't show off the power of zsh at all.

I thereby contribute a basic, uncontroversial version of my own prompt.
I think it would make a good addition to the existing prompts, and
could serve as a starting point for other users.

# leah2 prompt theme
# by <leah@xxxxxxxx>

prompt_leah2_help () {
    cat <<'EOF'
Simple single line prompt which tries to display only the information you need:
- status if last command had non-zero status
- number of background jobs if non-zero
- two last segments of cwd
- prompt sigil is doubled when logged in via SSH, and red when root
I usually use this in a white on black terminal.

prompt_leah2_setup () {
  PS1='%B%m%(?.. %??)%(1j. %j&.)%b %2~%B%(!.%F{red}.%F{yellow})%#${SSH_CONNECTION:+%#} %b%f'
  PS2='%_%B%(!.%F{red}.%F{yellow})> %b%f'
  prompt_opts=( cr percent subst )

prompt_leah2_setup "$@"

Leah Neukirchen  <leah@xxxxxxxx>  http://leah.zone

Messages sorted by: Reverse Date, Date, Thread, Author