Created
November 27, 2018 02:37
-
-
Save kurtbartholomew/c3823cfa0510dfdafbd16024c23ef365 to your computer and use it in GitHub Desktop.
Shell Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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