Skip to content

Instantly share code, notes, and snippets.

@meonkeys
Created December 3, 2014 18:33
Show Gist options
  • Save meonkeys/4c9a3d0bc6be44c83484 to your computer and use it in GitHub Desktop.
Save meonkeys/4c9a3d0bc6be44c83484 to your computer and use it in GitHub Desktop.
bashrc git enhancements, emotiprompt
GIT_PS1_SHOWDIRTYSTATE=y
GIT_PS1_SHOWSTASHSTATE=y
GIT_PS1_SHOWUNTRACKEDFILES=y
GIT_PS1_SHOWUPSTREAM=auto
# ~ the Emotiprompt(TM) ~
# idea came from: http://linuxgazette.net/122/lg_tips.html#tips.1
smiley() {
err=$?
if [[ $err == 0 ]]
then echo ':)'
else echo ":( $err"
fi
}
PS1='$(smiley) [\u@\h \W$(__git_ps1 " <%s>")]\$ '
@meonkeys
Copy link
Author

meonkeys commented Dec 3, 2014

Also...

# list contents right after changing directories
cd() {
  if [[ "$1" ]]
  then builtin cd "$1" && ls
  else builtin cd && ls
  fi
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment