Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fancy bash prompt

  • Loading branch information...
commit 9892106882648383c3073e1cdc8ef249e2f1aeac 1 parent 4b7cba6
Todd Gehman authored
Showing with 13 additions and 1 deletion.
  1. +2 −0  bash/aliases
  2. +11 −1 bash/config
View
2  bash/aliases
@@ -28,5 +28,7 @@ alias watch-css='sass --watch public/stylesheets/_sass:public/stylesheets --styl
alias spec='/opt/local/bin/spec --options ~/spec.opts'
alias cuke='cucumber --format pretty'
+alias disk='du -h --max-depth=1'
+
# Mac Dock spacer command
# defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock'
View
12 bash/config
@@ -3,7 +3,17 @@ export EDITOR
unset USERNAME
-PS1="\[\e[32;1m\]\u@\[\e[34;1m\]\h\[\e[36;1m\] \W/ > \[\e[0m\]"
+# PS1="\[\e[32;1m\]\u@\[\e[34;1m\]\h\[\e[36;1m\] \W/ > \[\e[0m\]"
+# $(git branch 2>/dev/null | grep '^*' | colrm 1 2)
+# git info: "...\`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\\\\\*\ \(.+\)$/\(\\\\\\\\\1\)\ /\`
+
+__parse_git_branch() {
+ git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
+}
+
+PS1="\n\[\e[0;36m\]┌─[\[\e[0m\]\[\e[1;32m\]\u\[\e[0m\]\[\e[1;36m\]@\[\e[0m\]\[\e[1;34m\]\h\[\e[0m\]\[\e[0;36m\]]─[\[\e[0m\]\[\e[1;37m\]\w\[\e[0m\]\[\e[0;36m\]]\[\e[0;36m\]─[\[\e[0m\]\[\e[0;33m\]\$(__parse_git_branch)\[\e[0m\]\[\e[0;36m\]]\[\e[0m\]\n\[\e[0;36m\]└─[\[\e[0m\]\[\e[1;37m\]\$\[\e[0m\]\[\e[0;36m\]]› \[\e[0m\]"
+# PS1="\[33[01;32m\]\u@\h\[33[01;34m\] \w \[33[00m\]\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\[33[01;34m\] \$\[33[00m\] "
+
export PS1
# a black
Please sign in to comment.
Something went wrong with that request. Please try again.