Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # echo is like puts for bash (bash is the program running in your terminal)
- echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open"
- # $VARIABLE will render before the rest of the command is executed
- echo "Logged in as $USER at $(hostname)"
- # Load RVM into a shell session *as a function*
- [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
- # Path for RVM
- test -d "$HOME/.rvm/bin" && PATH="$PATH:$HOME/.rvm/bin"
- # Rbenv autocomplete and shims
- if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
- # Path for RBENV
- test -d "$HOME/.rbenv/" && PATH="$HOME/.rbenv/bin:$PATH"
- le
- # Path changes are made non-destructive with PATH=new_path;$PATH This is like A=A+B so we preserve the old path
- # Path order matters, putting /usr/local/bin before /usr/bin
- # ensures brew programs will be seen and used before another program
- # of the same name is called
- # Path for brew
- test -d /usr/local/bin && export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
- # Path for Heroku
- test -d /usr/local/heroku/ && export PATH="/usr/local/heroku/bin:$PATH"
- # Load git completions
- git_completion_script=/usr/local/etc/bash_completion.d/git-completion.bash
- test -s $git_completion_script && source $git_completion_script
- # A more colorful prompt
- # \[\e[0m\] resets the color to default color
- ColorReset='\[\e[0m\]'
- # \e[0;31m\ sets the color to red
- ColorRed='\[\e[0;31m\]'
- # \e[0;32m\ sets the color to green
- ColorGreen='\[\e[0;32m\]'
- # PS1 is the variable for the prompt you see everytime you hit enter
- git_prompt_script=/usr/local/etc/bash_completion.d/git-prompt.sh
- if [ -s $git_prompt_script ]; then
- # if git-prompt is installed, use it (ie. to install it use:
- # `brew install git`)
- source $git_prompt_script
- export GIT_PS1_SHOWDIRTYSTATE=1
- export PS1="\n$ColorRed\W$ColorReset$(__git_ps1)$ColorReset :>"
- else
- # otherwise omit git from the prompt
- export PS1="\n$ColorRed\W$ColorReset :> "
- fi
- # Git branch in prompt.
- parse_git_branch() {
- git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
- }
- export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
- # Colors ls should use for folders, files, symlinks etc, see `man ls` and
- # search for LSCOLORS
- export LSCOLORS=ExGxFxdxCxDxDxaccxaeex
- # Force ls to use colors (G) and use humanized file sizes (h)
- alias ls='ls -Gh'
- # Force grep to always use the color option and show line numbers
- export GREP_OPTIONS='--color=always'
- # Set atom as the default editor
- which -s atom && export EDITOR="atom -nw"
- # Useful aliases
- alias e="atom"
- alias be="bundle exec"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement