Skip to content

Instantly share code, notes, and snippets.

@kurtbartholomew
Created November 27, 2018 02:37
Show Gist options
  • Save kurtbartholomew/c3823cfa0510dfdafbd16024c23ef365 to your computer and use it in GitHub Desktop.
Save kurtbartholomew/c3823cfa0510dfdafbd16024c23ef365 to your computer and use it in GitHub Desktop.
Shell Profile
#user-defined aliases
alias rm='rm -vi'
alias cp='cp -vi'
alias mv='mv -vi'
alias clean='rm -f "#"* "."*~ *~ *.bak *.dvi *.aux *.log'
alias svim='sudo vim'
# Prevent history duplication
export HISTCONTROL=ignoredups
# cd aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
# cd into the old directory
alias bd='cd "$OLDPWD"'
# alias use global browsersync install
alias localserve='browser-sync start --server --files "**/*.(css|html|js)"'
# Grab current git branch for prompt
function find_git_branch {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head == ref:\ refs/heads/* ]]; then
git_branch=" (${head#*/*/})"
elif [[ $head != '' ]]; then
git_branch=' (detached)'
else
git_branch=' (unknown)'
fi
return
fi
dir="../$dir"
done
git_branch=''
}
# Initialize $git_branch data for prompt
PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;32m\]\$git_branch\[\033[01;34m\]\n\$ \[\033[00m\]"
#export NVM_DIR="/Users/kurt/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
#JAVA_HOME=/Library/Java/Home
#export JAVA_HOME
#export JAVA_HOME=`/usr/libexec/java_home`
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
#export PATH="/Users/username/.pyenv:$PATH"
#eval "$(pyenv init -)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment