Skip to content

Instantly share code, notes, and snippets.

@jfelipe
Created March 3, 2014 21:38
Show Gist options
  • Save jfelipe/9335147 to your computer and use it in GitHub Desktop.
Save jfelipe/9335147 to your computer and use it in GitHub Desktop.
zlogin
# adds the current branch name in green
git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null)
if [[ -n $ref ]]; then
echo "[%{$fg_bold[green]%}${ref#refs/heads/}%{$reset_color%}]"
fi
}
# makes color constants available
autoload -U colors
colors
# enable colored output from ls, etc
export CLICOLOR=1
export LSCOLORS=cafxcxdxbxegedabageaea
# expand functions in the prompt
setopt promptsubst
# prompt
export PS1='$(git_prompt_info)[${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}] '
# load thoughtbot/dotfiles scripts
export PATH="$HOME/.bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment