Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 65 lines (46 sloc) 1.707 kb
4ce773a @jyurek Added bash config
authored
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 {
6 git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
7 }
8
9 function latest_command {
10 history | tail -n 1 | sed 's/[0-9 ]*\(.*\)/\1/'
11 }
12
13 function growl_latest_command {
14 latest_command | growlnotify -n "Command Prompt" `pwd` 1>/dev/null 2>&1
15 }
16
17 function prompt_command_function
18 {
19 last_result="\[\e[33m\]$?\[\e[0m\]"
20 titlebar_last_command="\[\e]2;$(latest_command)\a\]"
21
22 growl_latest_command
23
24 git_branch=$(parse_git_branch)
25 git_dirty= #$(parse_git_dirty)
26
27 git_dirty=${git_dirty:+" \[\e[31m\]$git_dirty\[\e[0m\]"}
28 git_branch=${git_branch:+" (\[\e[35m\]${git_branch}\[\e[0m\]${git_dirty})"}
29
30 PS1="$titlebar_last_command$last_result \h:\[\e[32m\]\w\[\e[0m\] \u$git_branch\$ "
31 }
32
33 function gemcd {
34 cd `dirname \`gem which $1\``
35 }
36
37 export PROMPT_COMMAND=prompt_command_function
38
ac895ef @jyurek Removed old stuff from bashrc, made brew location more flexible
authored
39 export BREW=/usr/local/bin/brew
40 export PATH=`$BREW --prefix`/bin:`$BREW --prefix`/sbin:$HOME:$PATH:$HOME/bin
4ce773a @jyurek Added bash config
authored
41 export EDITOR=/usr/bin/vim
42
43 export CDPATH=.:~:~/Development
44 alias ...='cd ../..'
45 alias ....='cd ../../..'
46 alias .....='cd ../../../..'
47
48 export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home/"
49
50 alias rerc='source ~/.bash_profile'
51 alias l=ls
52 alias ll='ls -la'
53 alias s=true
54
ac895ef @jyurek Removed old stuff from bashrc, made brew location more flexible
authored
55 if [ -f `$BREW --prefix`/etc/bash_completion ]; then
56 . `$BREW --prefix`/etc/bash_completion
4ce773a @jyurek Added bash config
authored
57 fi
58
ac895ef @jyurek Removed old stuff from bashrc, made brew location more flexible
authored
59 if [ -f `$BREW --prefix`/etc/bash_completion.d/git-completion.bash ]; then
60 . `$BREW --prefix`/etc/bash_completion.d/git-completion.bash
4ce773a @jyurek Added bash config
authored
61 fi
62
ac895ef @jyurek Removed old stuff from bashrc, made brew location more flexible
authored
63 if [[ -s /Users/$USER/.rvm/scripts/rvm ]] ; then source /Users/$USER/.rvm/scripts/rvm ; fi
4ce773a @jyurek Added bash config
authored
64
Something went wrong with that request. Please try again.