Skip to content

Instantly share code, notes, and snippets.

@ykomatsu
Created June 29, 2015 12:07
Show Gist options
  • Save ykomatsu/4beec84806cb11ec2031 to your computer and use it in GitHub Desktop.
Save ykomatsu/4beec84806cb11ec2031 to your computer and use it in GitHub Desktop.
prompt_ykomatsu_setup
#! /bin/zsh
prompt_ykomatsu_precmd() {
vcs_info
}
prompt_ykomatsu_setup() {
prompt_opts=(cr percent sp subst)
autoload -Uz add-zsh-hook vcs_info
add-zsh-hook precmd prompt_ykomatsu_precmd
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' formats '%F{magenta}%b%f'
zstyle ':vcs_info:git:*' actionformats '%F{magenta}%b/%a%%f'
prompt="%F{cyan}%~%f ${vcs_info_msg_0_}
%(#.%F{red}%n%f .)%(?.%F{blue}➤.%F{red}%? ✘)%f "
}
prompt_ykomatsu_setup "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment