by miekg

miekg / lean

Pretty, minimal, one-line, fast ZSH prompt

134 Stars 32 Forks Last release: Not found 65 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


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.

lean example gif

So lean is an evolution of pure, with the following changes:

  • Defaults to a very sparse setup, only showing information you need at the moment.
  • Comes with the perfect prompt character. Author went through the entire ASCII range to find it (and found it pretty quickly!)
  • Never displays your username (assuming you know who you are).
  • When tmux is active it shows a yellow 't' (I disabled the tmux bar, so this is some visual indication that tmux is active). If you don't want this indicator, you can always set
    prior to loading this plugin (or prior to sourcing
    , etc.).
  • Show remote host if logged in through SSH.
  • All in one line, most stuff in the right prompt, leaving the left prompt nice and clean
  • Shows background jobs (in the left prompt)
  • Show (dirty) git repos
  • Shortens path if needed (longer then 70% of your screen). Two methods are provided: 'truncate' and 'shrink' (fish-style working directory). Set
    to choose the one you like the most (default is 'truncate').
  • Uses
    to allow customization of the left and/or right side of the prompt.
  • For a configurable insertmode indicator, set the
    defaults to
  • Configurable colors to match your preferred scheme, by setting
  • Use
    to customize when the title should not be display. Useful for terminals can not show title properly, for example terminals under Emacs (already considered by default). Write your own conditions for this variable and make sure it is 1 when you don't want title.

When lean starts, only 2 characters show on the screen '%' on the left and '~' on the right. All other info is omitted (like the user and system you are on), and shown only when needed.



If you use zgen you can add the following to your

zgen load miekg/lean

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

to module load list and select
as a theme: ``` zstyle ':prezto:load' pmodule \ ... \ 'contrib-prompt' \ 'prompt' \ ...

zstyle ':prezto:module:prompt' theme 'lean' ```

should be customized in
. The rest variables should be customized in


If you make any changes please run

make test
to ensure the (little) test suite is succesfull.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.