Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 82 lines (63 sloc) 2.08 kb
4ce773af »
2010-07-13 Added bash config
1 function parse_git_dirty {
2 [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo '✏ '
3 }
4
5 function parse_git_branch {
3607fb60 »
2010-08-16 Make the branch display simpler
6 git branch --no-color 2> /dev/null | grep \* | awk '{print $2}'
4ce773af »
2010-07-13 Added bash config
7 }
8
9 function latest_command {
10 history | tail -n 1 | sed 's/[0-9 ]*\(.*\)/\1/'
11 }
12
13 function growl_latest_command {
48987785 »
2010-08-16 Growl should make a sticky, high priority alert when there is a non-z…
14 priority="Normal"
15 sticky=
16 if (( $1 != 0 )); then
17 priority="High"
18 sticky="-s"
19 fi
20 latest_command | growlnotify -p $priority $sticky -n "Command Prompt" `pwd` 1>/dev/null 2>&1
4ce773af »
2010-07-13 Added bash config
21 }
22
23 function prompt_command_function
24 {
48987785 »
2010-08-16 Growl should make a sticky, high priority alert when there is a non-z…
25 last_result=$?
26 growl_latest_command $last_result
4ce773af »
2010-07-13 Added bash config
27
48987785 »
2010-08-16 Growl should make a sticky, high priority alert when there is a non-z…
28 last_result="\[\e[33m\]$last_result\[\e[0m\]"
29 titlebar_last_command="\[\e]2;$(latest_command)\a\]"
4ce773af »
2010-07-13 Added bash config
30
31 git_branch=$(parse_git_branch)
32 git_dirty= #$(parse_git_dirty)
33
34 git_dirty=${git_dirty:+" \[\e[31m\]$git_dirty\[\e[0m\]"}
35 git_branch=${git_branch:+" (\[\e[35m\]${git_branch}\[\e[0m\]${git_dirty})"}
36
37 PS1="$titlebar_last_command$last_result \h:\[\e[32m\]\w\[\e[0m\] \u$git_branch\$ "
38 }
39
40 function gemcd {
41 cd `dirname \`gem which $1\``
42 }
43
44 export PROMPT_COMMAND=prompt_command_function
45
ac895ef2 »
2010-07-27 Removed old stuff from bashrc, made brew location more flexible
46 export BREW=/usr/local/bin/brew
48987785 »
2010-08-16 Growl should make a sticky, high priority alert when there is a non-z…
47 export PATH=`$BREW --prefix`/bin:`$BREW --prefix`/sbin:$HOME:$PATH:$HOME/bin:`$BREW --prefix`/Cellar/python/2.7/bin
4ce773af »
2010-07-13 Added bash config
48 export EDITOR=/usr/bin/vim
49
50 export CDPATH=.:~:~/Development
51 alias ...='cd ../..'
52 alias ....='cd ../../..'
53 alias .....='cd ../../../..'
54
55 alias rerc='source ~/.bash_profile'
56 alias l=ls
57 alias ll='ls -la'
58 alias s=true
8b0a5d42 »
2010-08-18 Alias mvim to open new files in the same window, but new tab.
59 alias mvim='mvim --servername VIM --remote-tab-silent'
4ce773af »
2010-07-13 Added bash config
60
60664a7a »
2010-08-08 Removed and put in AWS account switching
61 export AWS_ACCOUNT=jyurek
62 function load_aws {
63 if [ -f $HOME/.aws/$1 ]; then
64 source $HOME/.aws/$1
65 export AWS_ACCOUNT=$1
66 else
67 echo "No AWS Credentials for $1"
68 fi
69 }
70 load_aws $AWS_ACCOUNT
71
ac895ef2 »
2010-07-27 Removed old stuff from bashrc, made brew location more flexible
72 if [ -f `$BREW --prefix`/etc/bash_completion ]; then
73 . `$BREW --prefix`/etc/bash_completion
4ce773af »
2010-07-13 Added bash config
74 fi
75
ac895ef2 »
2010-07-27 Removed old stuff from bashrc, made brew location more flexible
76 if [ -f `$BREW --prefix`/etc/bash_completion.d/git-completion.bash ]; then
77 . `$BREW --prefix`/etc/bash_completion.d/git-completion.bash
4ce773af »
2010-07-13 Added bash config
78 fi
79
ac895ef2 »
2010-07-27 Removed old stuff from bashrc, made brew location more flexible
80 if [[ -s /Users/$USER/.rvm/scripts/rvm ]] ; then source /Users/$USER/.rvm/scripts/rvm ; fi
4ce773af »
2010-07-13 Added bash config
81
Something went wrong with that request. Please try again.