.profile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ###############################################################################
  2. # Non-interactive shell configuration
  3. ###############################################################################
  4. OS=$(uname -s)
  5. # Add $HOME/bin to PATH
  6. export PATH="$PATH:$HOME/bin"
  7. # Homebrew
  8. export PATH="$PATH:$HOME/homebrew/bin"
  9. BREW_BIN=$(which brew)
  10. BREW_PREFIX=$(which brew &>/dev/null && brew --prefix || echo "")
  11. if [ "$BREW_BIN" ]; then
  12. export PYTHONPATH="$BREW_PREFIX/lib/python2.7/site-packages/" # also facilitates: easy_install -d "$PYTHONPATH" awesome_pkg
  13. export HOMEBREW_CASK_OPTS="--caskroom=$BREW_PREFIX/Caskroom --appdir=$HOME/Applications"
  14. fi
  15. # Default editor
  16. export EDITOR="vim"
  17. # Help things find Google Chrome
  18. if [ "$OS" = "Darwin" ]; then
  19. CHROME_BIN="$HOME/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
  20. ! [ -f "$CHROME_BIN" ] || export CHROME_BIN
  21. fi
  22. # Configure go lang
  23. if [ "$OS" = "Darwin" ]; then
  24. export GOROOT="$BREW_PREFIX/opt/go/libexec"
  25. else
  26. export GOROOT="$HOME/golang"
  27. fi
  28. export PATH="$PATH:$GOROOT/bin"
  29. export GOPATH="$HOME/go"
  30. export PATH="$PATH:$GOPATH/bin"
  31. # Configure less allow colors
  32. export LESS="-FRX"
  33. # If not running interactively, don't do anything else
  34. [ "$PS1" ] || return
  35. ###############################################################################
  36. # Interactive shell configuration
  37. ###############################################################################
  38. # tweak history behavior a bit
  39. HISTSIZE=50000
  40. HISTFILESIZE=500000
  41. HISTCONTROL="ignoreboth"
  42. shopt -s histappend
  43. # check window size after each command
  44. shopt -s checkwinsize
  45. # Custom shell aliases
  46. if [ "$OS" = "Darwin" ]; then
  47. export CLICOLOR="1"
  48. else
  49. alias ls="ls --color=auto"
  50. fi
  51. alias d="l"
  52. alias l="ls -CF"
  53. alias la="ls -A"
  54. alias ll="ls -alF"
  55. alias tree="tree -CF"
  56. export GREP_OPTIONS="--color --exclude-dir=.svn --exclude-dir=.git --exclude-dir=node_modules"
  57. # color diffs
  58. ! which colordiff &>/dev/null || alias diff="colordiff"
  59. # MacVim shell aliases
  60. if [ "$OS" = "Darwin" ]; then
  61. alias gvim="mvim"
  62. fi
  63. # bash completion FTW
  64. if [ "$OS" = "Darwin" ]; then
  65. F="$BREW_PREFIX/etc/bash_completion"; ! [ -f "$F" ] || . "$F"
  66. F="$(xcode-select -p)/usr/share/git-core/git-completion.bash"; ! [ -f "$F" ] || . "$F"
  67. else
  68. F="/etc/bash_completion"; ! [ -f "$F" ] || . "$F"
  69. fi
  70. # Liquid Prompt
  71. F="$HOME/.liquidprompt/liquidprompt"; ! [ -f "$F" ] || . "$F"
  72. # gimme gimme
  73. [ -d "$HOME/.gimme" ] || curl -fsSL "https://github.com/KylePDavis/gimme/raw/master/gimme" | bash -
  74. F="$HOME/.gimme/gimme"; ! [ -f "$F" ] || . "$F"