Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. # echo is like puts for bash (bash is the program running in your terminal)
  2. # echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open"
  3.  
  4. # $VARIABLE will render before the rest of the command is executed
  5. # echo "Logged in as $USER at $(hostname)"
  6.  
  7. # Load RVM into a shell session *as a function*
  8. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  9. # Path for RVM
  10. test -d $HOME/.rvm/bin && PATH=$PATH:$HOME/.rvm/bin
  11.  
  12. # Rbenv autocomplete and shims
  13. if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
  14. # Path for RBENV
  15. test -d $HOME/.rbenv/ && PATH="$HOME/.rbenv/bin:$PATH"
  16.  
  17. # Path changes are made non-destructive with PATH=new_path;$PATH This is like A=A+B so we preserve the old path
  18.  
  19. # Path order matters, putting /usr/local/bin: before $PATH
  20. # ensures brew programs will be seen and used before another program
  21. # of the same name is called
  22.  
  23. # Path for brew
  24. test -d /usr/local/bin && export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
  25. # Path for Heroku
  26. test -d /usr/local/heroku/ && export PATH="/usr/local/heroku/bin:$PATH"
  27.  
  28. # Load git completions
  29. git_completion_script=/usr/local/etc/bash_completion.d/git-completion.bash
  30. test -s $git_completion_script && source $git_completion_script
  31.  
  32. # A more colorful prompt
  33. # \[\e[0m\] resets the color to default color
  34. c_reset='\[\e[0m\]'
  35. # \e[0;31m\ sets the color to green
  36. c_path='\[\e[0;32m\]'
  37. # \e[0;32m\ sets the color to underline green
  38. c_git_clean='\[\e[4;32m\]'
  39. # \e[0;31m\ sets the color to red
  40. c_git_dirty='\[\e[0;31m\]'
  41.  
  42. # PS1 is the variable for the prompt you see everytime you hit enter
  43. # PROMPT_COMMAND='PS1="${c_path}\W${c_reset}$(git_prompt) ♥ "'
  44. PROMPT_COMMAND='PS1="${c_path}\W${c_reset}$(git_prompt) ♫ "'
  45.  
  46. # determines if the git branch you are on is clean or dirty
  47. git_prompt ()
  48. {
  49. if ! git rev-parse --git-dir > /dev/null 2>&1; then
  50. return 0
  51. fi
  52. # Grab working branch name
  53. git_branch=$(Git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
  54. # Clean or dirty branch
  55. if git diff --quiet 2>/dev/null >&2; then
  56. git_color="${c_git_clean}"
  57. else
  58. git_color=${c_git_dirty}
  59. fi
  60. echo " [$git_color$git_branch${c_reset}]"
  61. }
  62.  
  63. # Colors ls should use for folders, files, symlinks etc, see `man ls` and
  64. # search for LSCOLORS
  65. export LSCOLORS=ExGxFxdxCxDxDxaccxaeex
  66. # Force ls to use colors (G) and use humanized file sizes (h)
  67. alias ls='ls -Gh'
  68.  
  69. # Force grep to always use the color option and show line numbers
  70. export GREP_OPTIONS='--color=always'
  71.  
  72. # Set sublime as the default editor
  73. which -s subl && export EDITOR="subl --wait"
  74.  
  75. # Useful aliases
  76. alias e=subl
  77. alias a=atom
  78.  
  79. # rmtrash shortcut (moves file to trash)
  80. alias trash='rmtrash'
  81. alias del='rmtrash'
  82. alias rm="echo Use 'del', or the full path i.e. '/bin/rm'"
  83.  
  84. alias be="bundle exec"
  85. # Executes gem pry
  86. alias pry="/Users/dh/.rbenv/versions/2.0.0-p481/bin/./pry"
  87. alias rspec="/Users/dh/.rbenv/versions/2.0.0-p481/bin/./rspec"
  88.  
  89. alias bcm="bundle exec rake generate:migration"
  90.  
  91. # Rails alias
  92. alias br="bin/rails"
  93. alias bk="bin/rake"
  94.  
  95. # rake drop create migrate
  96. alias ra='rake db:drop db:create db:migrate'
  97. alias ras='rake db:drop db:create db:migrate db:seed'
  98.  
  99. ### Added by the Heroku Toolbelt
  100. export PATH="/usr/local/heroku/bin:$PATH"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement