.profile 2.3 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. else
  44. alias ls="ls --color=auto"
  45. fi
  46. alias d="l"
  47. alias l="ls -CF"
  48. alias la="ls -A"
  49. alias ll="ls -alF"
  50. alias tree="tree -CF"
  51. export GREP_OPTIONS="--color --exclude-dir=.svn --exclude-dir=.git --exclude-dir=node_modules"
  52. # color diffs
  53. ! which colordiff &>/dev/null || alias diff="colordiff"
  54. # MacVim shell aliases
  55. if [ "$OS" = "Darwin" ]; then
  56. alias gvim="mvim"
  57. fi
  58. # bash completion FTW
  59. if [ "$OS" = "Darwin" ]; then
  60. F="$BREW_PREFIX/etc/bash_completion"; ! [ -f "$F" ] || . "$F"
  61. F="/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash"; ! [ -f "$F" ] || . "$F"
  62. else
  63. F="/etc/bash_completion"; ! [ -f "$F" ] || . "$F"
  64. fi
  65. # Liquid Prompt
  66. F="$HOME/.liquidprompt/liquidprompt"; ! [ -f "$F" ] || . "$F"
  67. # gimme gimme
  68. [ -d "$HOME/.gimme" ] || curl -fsSL "https://github.com/KylePDavis/gimme/raw/master/gimme" | bash -
  69. F="$HOME/.gimme/gimme"; ! [ -f "$F" ] || . "$F"