Skip to content

Instantly share code, notes, and snippets.

@maclunar
Created May 7, 2018 06:02
Show Gist options
  • Save maclunar/3b49139cd602fbb63a4c8b84c2eb0977 to your computer and use it in GitHub Desktop.
Save maclunar/3b49139cd602fbb63a4c8b84c2eb0977 to your computer and use it in GitHub Desktop.
# Load the default .profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# For RVM and nvm
if [ -d "$HOME/Code" ] ; then
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
fi
# platform-tools for android shenanigans
if [ -d "$HOME/platform-tools" ] ; then
export PATH="$HOME/platform-tools:$PATH"
fi
# qt and geckodriver for capybara js testing
export PATH="$(brew --prefix [email protected])/bin:$PATH"
export PATH="~/.gem/geckodiver:$PATH"
# Set vi editing mode
set -o vi
# Bash completion
test -f ~/.git-completion.bash && . $_
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Color directories
alias ls='ls -G '
LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS
# For forward history search in bash
stty -ixon
# Don't record duplicates in bash history
export HISTCONTROL=ignoreboth:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# imprevements to grep
alias grep='grep -I '
# export Vim as $EDITOR (for tmuxinator)
export EDITOR='vim'
# add global .ignore file for the silver searcher
alias ag='ag --path-to-ignore ~/.ignore'
# Prompt --------------------------------------------------
CYAN="\[$(tput setaf 49)\]"
PINK="\[$(tput setaf 201)\]"
RESET="\[$(tput sgr0)\]"
branch() {
git branch 2>/dev/null | grep '^*' | colrm 1 2
}
export PS1="${CYAN}\w${RESET}:${PINK}\$(branch) ${RESET}\$ "
# Aliases -------------------------------------------------
## git
#alias got='git'
#alias get='git'
alias gs='git status '
alias ga='git add -p '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias got='git checkout --track origin/'
__git_complete go _git_checkout
__git_complete got _git_checkout
alias gp='git pull'
# push to remote
alias gpr='git push --set-upstream origin'
__git_complete gpr _git_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment