Skip to content

Instantly share code, notes, and snippets.

Created May 21, 2015 03:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# A colorful, friendly, multiline theme with some handy features.
# Based on the 'giddie' theme by Paul Gideon Dann.
# Authors:
# Michael Kohl <>
# Paul Gideon Dann <>
# Sorin Ionescu <>
# Features:
# - Simple VCS branch, staged, and unstaged indication.
# - Last command exit status is displayed in RPROMPT when non-zero.
# Screenshots:
function +vi-git_precmd {
# Check for untracked files, since vcs_info does not.
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
function prompt_citizen428_precmd {
# Replace '/home/<user>' with '~'.
function prompt_citizen428_setup {
prompt_opts=(cr percent subst)
# Load required functions.
autoload -Uz vcs_info
autoload -Uz add-zsh-hook
# Add hook to set up prompt parameters before each command.
add-zsh-hook precmd prompt_citizen428_precmd
# Set vcs_info parameters.
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats '[%b%c%u]'
zstyle ':vcs_info:*' actionformats '[%b%c%u %F{magenta}(%a)%f]'
zstyle ':vcs_info:*' stagedstr '%F{green}●%f'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●%f'
# Set vcs_info hooks.
# NOTE: Prior to Zsh v4.3.12, there are no static hooks, no vcs_info_hookadd
# function, and no 'no-vcs' hook.
zstyle ':vcs_info:git*+set-message:*' git_precmd
# Set ruby-info parameters
zstyle ':prezto:module:ruby:info:version' format '%v'
# Define prompts.
PROMPT='%(?..%F{red}%B[✘] %b%f)%F{green}%n@%m%f %F{blue}[${_prompt_citizen428_pwd}]%f %F{red}[$ruby_info[version]]%f %F{yellow}${vcs_info_msg_0_}%f
%F{white}→%f '
SPROMPT='zsh: correct %F{magenta}%R%f to %F{green}%r%f [nyae]? '
prompt_citizen428_setup "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment