Advertisement
Guest User

Untitled

a guest
May 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 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. le
  17.  
  18. # Path changes are made non-destructive with PATH=new_path;$PATH This is like A=A+B so we preserve the old path
  19.  
  20. # Path order matters, putting /usr/local/bin before /usr/bin
  21. # ensures brew programs will be seen and used before another program
  22. # of the same name is called
  23.  
  24. # Path for brew
  25. test -d /usr/local/bin && export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
  26. # Path for Heroku
  27. test -d /usr/local/heroku/ && export PATH="/usr/local/heroku/bin:$PATH"
  28.  
  29. # Load git completions
  30. git_completion_script=/usr/local/etc/bash_completion.d/git-completion.bash
  31. test -s $git_completion_script && source $git_completion_script
  32.  
  33. # A more colorful prompt
  34. # \[\e[0m\] resets the color to default color
  35. ColorReset='\[\e[0m\]'
  36. # \e[0;31m\ sets the color to red
  37. ColorRed='\[\e[0;31m\]'
  38. # \e[0;32m\ sets the color to green
  39. ColorGreen='\[\e[0;32m\]'
  40.  
  41. # PS1 is the variable for the prompt you see everytime you hit enter
  42. git_prompt_script=/usr/local/etc/bash_completion.d/git-prompt.sh
  43. if [ -s $git_prompt_script ]; then
  44. # if git-prompt is installed, use it (ie. to install it use:
  45. # `brew install git`)
  46. source $git_prompt_script
  47. export GIT_PS1_SHOWDIRTYSTATE=1
  48. export PS1="\n$ColorRed\W$ColorReset$(__git_ps1)$ColorReset :>"
  49. else
  50. # otherwise omit git from the prompt
  51. export PS1="\n$ColorRed\W$ColorReset :> "
  52. fi
  53.  
  54. # Git branch in prompt.
  55.  
  56. parse_git_branch() {
  57.  
  58. git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
  59.  
  60. }
  61.  
  62. export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
  63.  
  64. # Colors ls should use for folders, files, symlinks etc, see `man ls` and
  65. # search for LSCOLORS
  66. export LSCOLORS=ExGxFxdxCxDxDxaccxaeex
  67. # Force ls to use colors (G) and use humanized file sizes (h)
  68. alias ls='ls -Gh'
  69.  
  70. # Force grep to always use the color option and show line numbers
  71. export GREP_OPTIONS='--color=always'
  72.  
  73. # Set atom as the default editor
  74. which -s atom && export EDITOR="atom -nw"
  75.  
  76. # Useful aliases
  77.  
  78. alias e="atom"
  79. alias be="bundle exec"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement