After having used prompt pure for about a year, I felt that a two-line prompt was not for me. Also not utilizing the right side of the terminal seemed a missed opportunity. Still there is much to like: the elapsed time of a process, the coloring of the prompt if the exit code of the process isn't 0, git integration. So I took "pure", mixed in my ideas of what a prompt should look like and came up with "lean" - a 1 line prompt that stays out of your face.
When lean starts, only 2 characters show on the screen '%' on the left and '~' on the right.
So lean is an evolution of pure, with the following changes:
PROMPT_LEAN_TMUX=""
prior to loading this plugin (or prior to sourcing zgen
, etc.).PROMPT_LEAN_VCS
to 0
). The branch name is truncated to 20 characters.PROMPT_LEAN_ABBR_METHOD
to choose the one you like the most (default is 'truncate'). Set PROMPT_LEAN_PWD
to 0
to disable showing the path altogether.PROMPT_LEAN_LEFT
and PROMPT_LEAN_RIGHT
to allow customization of the left and/or right side of the prompt.PROMPT_LEAN_VIMODE
and PROMPT_LEAN_VIMODE_FORMAT
variables. PROMPT_LEAN_VIMODE_FORMAT
defaults to "%F{red}[NORMAL]%f"
PROMPT_LEAN_COLOR1
and PROMPT_LEAN_COLOR2
PROMPT_LEAN_NOTITLE
to customize when the title should not be displayed. Useful for terminals that can not show title properly.PROMPT_LEAN_VCS
and PROMPT_LEAN_PWD
to disable showing VCS info or the current working directory.If you use zgen you can add the following to your ~/.zshrc
:
and force reload with zgen reset && source ~/.zshrc
.
Note you must have the option PROMPT_SUBST set, see zshoptions(1).
If you use prezto you should do the following:
cd $ZPREZTODIR && git clone --recurse-submodules https://github.com/belak/prezto-contrib contrib
Then in ~/.zpreztorc
add contrib-prompt
to module load list and select lean
as a theme:
zstyle ':prezto:load' pmodule \
... \
'contrib-prompt' \
'prompt' \
...
zstyle ':prezto:module:prompt' theme 'lean'
PROMPT_LEAN_LEFT
and PROMPT_LEAN_RIGHT
should be customized in ~/.zshrc
. The rest variables should be customized in ~/.zshenv
.
If you make any changes please run make test
to ensure the (little) test suite is succesfull.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4