ABBR ZSH theme

October 25, 2018 ยท View on GitHub

Screenshots

Screenshot

Information

If you like the theme, or even better, you are using it, please consider giving this repository a star to let me know! :smiley:
Also, if you have got any improvements to the theme, feel free to send a pull request!

Segments

  • Exit code (tick on 0, else exit code) with colorization
  • hostname/username
  • Abbreviated PWD
  • $ or # (privilege)

Badges

  • Python (works with virtualenv, venv and Pipenv shell)
  • Rust version (detects Cargo.toml)
  • Git status (branch name, untracked, dirty)

Variables

VariableDefault
ABBR_BADGE_PYTHON_PREFIXempty
ABBR_BADGE_RUST_PREFIXempty
ABBR_BADGE_GIT_PREFIX\u00b1
ABBR_BADGE_GIT_UNTRACKED_SYMBOL?
ABBR_BADGE_GIT_DIRTY_SYMBOL!

Colors

You can change the prompt colors by changing these variables in your .zshrc.

VariableDefault
ABBR_FG_RETVAL_GOODwhite
ABBR_BG_RETVAL_GOODgreen
ABBR_FG_RETVAL_BADyellow
ABBR_BG_RETVAL_BADblack
ABBR_FG_LOGONblack
ABBR_BG_LOGONcyan
ABBR_FG_PWDwhite
ABBR_BG_PWDnone
ABBR_FG_PROMPT_ROOTred
ABBR_BG_PROMPT_ROOTnone
ABBR_FG_PROMPT_DEFAULT$ABBR_BG_LOGON
ABBR_BG_PROMPT_DEFAULTnone
ABBR_FG_BADGE_PYTHONblue
ABBR_BG_BADGE_PYTHONyellow
ABBR_FG_BADGE_RUSTwhite
ABBR_BG_BADGE_RUSTblue
ABBR_FG_BADGE_GITyellow
ABBR_BG_BADGE_GITblack
ABBR_FG_BADGE_GIT_UNTRACKEDred
ABBR_FG_BADGE_GIT_DIRTYred

How does the path abbreviation work?

Basically, similar to the one you find in vim. Every path inside the home directory will start with ~ rather than the absolute path. Each directory in the current PWD will be shortened to one character, execept it starts with a ., then, two characters will be displayed. The current folder will not be abbreviated.

Examples (username is phil):

  • /home/phil -> ~
  • /home/phil/test/abc -> ~/t/abc
  • /home/phil/.local/share/nano -> ~/.l/s/nano
  • /home/phil_butnotphil/test -> /h/p/test
  • /home/linus -> /h/linus