diff --git a/bashrc b/bashrc new file mode 100644 index 00000000..37e77a9d --- /dev/null +++ b/bashrc @@ -0,0 +1,36 @@ +# Use ~/.bashrc for things that you want around in subshells that wouldn't +# otherwise be inherited. So, aliases, completions, and functions. + +alias coffee='countdown 5 "The coffee should be ready."' +alias water='countdown 42 "The water should be boiling by now."' + +alias ls='ls -Gh' +alias git=hub +alias migrate='rake db:migrate db:test:prepare' +alias rails='generate-rails-app' +alias ri='ri --system' +alias sc='script/console' +alias ss='script/server' +alias v=mvim +alias wip='rake cucumber:wip' + +function p { + cd ~/Code/$1; ls +} + +function pi { + cd ~/Code/.inactive/$1; ls +} + +if [ -f ${HOME}/.homebrew/etc/bash_completion ]; then + . ${HOME}/.homebrew/etc/bash_completion +fi + +complete -C "directory-complete ${HOME}/Code" -o default p +complete -C "directory-complete ${HOME}/Code/.inactive" -o default pi +complete -C rake-complete -o default rake +complete -W "ls refresh start stop" downloads + +if [ -f ${HOME}/.homebrew/Library/Contributions/brew_bash_completion.sh ]; then + . ${HOME}/.homebrew/Library/Contributions/brew_bash_completion.sh +fi diff --git a/profile b/profile index 01ee3bcf..6d69abf2 100644 --- a/profile +++ b/profile @@ -1,33 +1,12 @@ # vim: set filetype=sh : -alias coffee='countdown 5 "The coffee should be ready."' -alias water='countdown 42 "The water should be boiling by now."' -alias ls='ls -Gh' -alias git=hub -alias migrate='rake db:migrate db:test:prepare' -alias rails='generate-rails-app' -alias ri='ri --system' -alias sc='script/console' -alias ss='script/server' -alias v=mvim -alias wip='rake cucumber:wip' - -function p { - cd ~/Code/$1; ls -} - -function pi { - cd ~/Code/.inactive/$1; ls -} +# Use ~/.profile for things that can be inherited by subshells. As far as I +# know right now, that just means environment variables. # histappend and HIST* envars from # http://blog.macromates.com/2008/working-with-history-in-bash/ shopt -s histappend -if [ -f ${HOME}/.homebrew/etc/bash_completion ]; then - . ${HOME}/.homebrew/etc/bash_completion -fi - export EDITOR=vim export GEM_OPEN_EDITOR=mvim export GIT_PS1_SHOWDIRTYSTATE=yes @@ -49,11 +28,6 @@ xterm*|rxvt*) ;; esac -complete -C "directory-complete ${HOME}/Code" -o default p -complete -C "directory-complete ${HOME}/Code/.inactive" -o default pi -complete -C rake-complete -o default rake -complete -W "ls refresh start stop" downloads - -if [ -f ${HOME}/.homebrew/Library/Contributions/brew_bash_completion.sh ]; then - . ${HOME}/.homebrew/Library/Contributions/brew_bash_completion.sh +if [ -f ~/.bashrc ]; then + . ~/.bashrc fi