Skip to content

Instantly share code, notes, and snippets.

View ebdrummond's full-sized avatar

Erin Drummond ebdrummond

View GitHub Profile
@ebdrummond
ebdrummond / .zshrc
Created February 21, 2023 12:19
Show git branch name and dirty state in terminal
parse_git_branch() {
git_status="$(git status 2> /dev/null)"
pattern="On branch ([^[:space:]]*)"
if [[ ! ${git_status} =~ "(working (tree|directory) clean)" ]]; then
state="*"
fi
if [[ ${git_status} =~ ${pattern} ]]; then
branch=${match[1]}
branch_cut=${branch:0:35}
if (( ${#branch} > ${#branch_cut} )); then

Keybase proof

I hereby claim:

  • I am ebdrummond on github.
  • I am ebdrummond (https://keybase.io/ebdrummond) on keybase.
  • I have a public key ASDYjhcZYU_E73qbdei7PgJzZxQL6WplzNEDSee-4SUkKAo

To claim this, I am signing this object:

@ebdrummond
ebdrummond / bash_profile
Created September 26, 2013 02:14
Bash profile
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
EDITOR=subl
GIT_EDITOR=subl
PATH=~/bin:$PATH
alias cdp="cd /Users/erindrummond/projects"