Skip to content

Instantly share code, notes, and snippets.

@kaplan81
Created January 3, 2020 20:34
Show Gist options
  • Save kaplan81/a877be50948650dcbf293997daa34f8e to your computer and use it in GitHub Desktop.
Save kaplan81/a877be50948650dcbf293997daa34f8e to your computer and use it in GitHub Desktop.
# This sets up Version Control System Info (vcs_info).
autoload -Uz vcs_info
# This hook function is executed before each prompt.
precmd() { vcs_info }
# This is needed to add this to our prompt: ${vcs_info_msg_0_}
setopt prompt_subst
# %F stands for foreground color and you reset it with %f.
# %B stands for bold and you reset it with %b.
# Color is set between brackets ({}) and it follows this reference>:
# https://jonasjacek.github.io/colors/
# %3~ shows the last 3 directories with regard to the user one (~).
# %~ is the current working directory relative to the home directory.
PROMPT='%F{28}%2~%f %B%F{166}${vcs_info_msg_0_}%f%b '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment