Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Contribution: prompt leah2
- X-seq: zsh-workers 41478
- From: Leah Neukirchen <leah@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Contribution: prompt leah2
- Date: Mon, 31 Jul 2017 22:14:44 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi,
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.
EOF
}
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 "$@"
Enjoy,
--
Leah Neukirchen <leah@xxxxxxxx> http://leah.zone
Messages sorted by:
Reverse Date,
Date,
Thread,
Author