Skip to content

Instantly share code, notes, and snippets.

@Asoul
Created January 10, 2020 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Asoul/3dc2a52b7c82e33cabeb8d65837b1e6f to your computer and use it in GitHub Desktop.
Save Asoul/3dc2a52b7c82e33cabeb8d65837b1e6f to your computer and use it in GitHub Desktop.
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Execute function in prompt
setopt PROMPT_SUBST
# Enable color in prompt
autoload -U colors && colors
PROMPT='%{$fg[cyan]%}%n%{$reset_color%} @ %{$fg[red]%}%m:%{$reset_color%}%{$fg[yellow]%}%~%{$reset_color%}%{$fg[green]%}$(parse_git_branch)%{$reset_color%} $ '
# Global Shortcut
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
alias ls='ls -G'
alias python=/usr/local/bin/python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment