.profile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 --binarydir=$BREW_PREFIX/bin"
  14. fi
  15. # Default editor
  16. export EDITOR="vim"
  17. # Configure go lang
  18. if [ "$OS" = "Darwin" ]; then
  19. export GOROOT="$BREW_PREFIX/opt/go"
  20. else
  21. export GOROOT="$HOME/golang"
  22. fi
  23. export PATH="$PATH:$GOROOT/bin"
  24. export GOPATH="$HOME/go"
  25. export PATH="$PATH:$GOPATH/bin"
  26. # Configure less allow colors
  27. export LESS="-FRX"
  28. # If not running interactively, don't do anything else
  29. [ "$PS1" ] || return
  30. ###############################################################################
  31. # Interactive shell configuration
  32. ###############################################################################
  33. # tweak history behavior a bit
  34. HISTSIZE=50000
  35. HISTFILESIZE=500000
  36. HISTCONTROL="ignoreboth"
  37. shopt -s histappend
  38. # check window size after each command
  39. shopt -s checkwinsize
  40. # Custom shell aliases
  41. if [ "$OS" = "Darwin" ]; then
  42. export CLICOLOR="1"
  43. fi
  44. alias d="l"
  45. alias l="ls -CF"
  46. alias la="ls -A"
  47. alias ll="ls -alF"
  48. alias tree="tree -CF"
  49. export GREP_OPTIONS="--color --exclude-dir=.svn --exclude-dir=.git --exclude-dir=node_modules"
  50. # color diffs
  51. ! which colordiff &>/dev/null || alias diff="colordiff"
  52. # MacVim shell aliases
  53. if [ "$OS" = "Darwin" ]; then
  54. alias gvim="mvim"
  55. fi
  56. # bash completion FTW
  57. if [ "$OS" = "Darwin" ]; then
  58. ! [ -f "$BREW_PREFIX/etc/bash_completion" ] || . "$BREW_PREFIX/etc/bash_completion"
  59. else
  60. ! [ -f "/etc/bash_completion" ] || . "/etc/bash_completion"
  61. fi
  62. # Git shell aliases
  63. F="/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash"; ! [ -f "$F" ] || . "$F"
  64. # Liquid Prompt
  65. F="$HOME/.liquidprompt/liquidprompt"; ! [ "$PS1" -a -f "$F" ] || . "$F"
  66. # gimme gimme
  67. [ -d "$HOME/.gimme" ] || curl -fsSL "https://github.com/KylePDavis/gimme/raw/master/gimme" | bash -
  68. ! [ -f "$HOME/.gimme/gimme" ] || . "$HOME/.gimme/gimme"