Created
October 7, 2015 17:10
-
-
Save llowder/541e65d45588535f113d to your computer and use it in GitHub Desktop.
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
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
#Grab the global bashrc, if there is one. | |
[[ -s /etc/bashrc ]] && source /etc/bashrc | |
export PATH="$PATH:~/bin" | |
export HISTSIZE=10000 | |
export HISTFILESIZE=10000 | |
export HISTTIMEFORMAT="%h %d %H:%M:%S " | |
unset MAILCHECK | |
shopt -s cdable_vars | |
shopt -s cdspell | |
shopt -s checkhash | |
shopt -s checkwinsize | |
shopt -u mailwarn | |
shopt -s histreedit | |
shopt -s histappend | |
export PROMPT_COMMAND='history -a' | |
export HISTCONTROL="ignoredups" | |
export HISTIGNORE="&:[bf]g:exit:ll:ls:bye:history" | |
shopt -s cmdhist | |
alias rehash='source ~/.profile' | |
alias word='grep \!* /usr/share/dict/web2' # Grep thru dictionary | |
#Navigation shortcuts | |
alias ..="cd .." | |
alias ..2="cd ../.." | |
alias ..3="cd ../../.." | |
alias ..4="cd ../../../.." | |
alias ..5="cd ../../../../.." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias ......="cd ../../../../.." | |
alias cd...="cd ../.." | |
alias cd....="cd ../../.." | |
alias cd.....="cd ../../../.." | |
alias cd......="cd ../../../../.." | |
alias lld='ls -lUd */' | |
alias .='pwd' | |
alias cdwd='cd `pwd`' | |
alias cwd='echo $cwd' | |
alias bye='logout' | |
alias du='du -kh' # Makes a more readable output. | |
alias df='df -kTh' | |
#vagrant shortcuts | |
alias vu="vagrant up" | |
alias vd="vagrant destroy" | |
alias vst="vagrant status" | |
alias vssh="vagrant ssh" | |
alias vsu="vagrant suspend" | |
#------------------------------------------------------------- | |
# The 'ls' family (this assumes you use a recent GNU ls). | |
#------------------------------------------------------------- | |
# Add colors for filetype and human-readable sizes by default on 'ls': | |
alias ls='ls -hFG' | |
alias lx='ls -lXB' # Sort by extension. | |
alias lk='ls -lSr' # Sort by size, biggest last. | |
alias lt='ls -ltr' # Sort by date, most recent last. | |
alias lc='ls -ltcr' # Sort by/show change time,most recent last. | |
alias lu='ls -ltur' # Sort by/show access time,most recent last. | |
# The ubiquitous 'll': directories first, with alphanumeric sorting: | |
alias ll='ls -lAFGhv' | |
alias lm='ll |more' # Pipe through 'more' | |
alias lr='ll -R' # Recursive ls. | |
alias tree='tree -Csuh' # Nice alternative to 'recursive ls' ... | |
# Path variabels for cdable_vars | |
## TODO: add others | |
if hash puppet 2>&-; then | |
export p_confdir=$(sudo puppet config print confdir) | |
i=0 | |
for x in $(sudo puppet config print modulepath | sed -e "s/:/ /g"); do | |
export p_modpath_${!i}=$x | |
let i++ | |
done | |
fi | |
export pdk="/users/llowder/code/puppet-debugging-kit/" | |
# which hack, so it also shows defined aliases and functions that match | |
which() { | |
which_out=`/usr/bin/which $@`; | |
if [ ! -z "$which_out" ]; then | |
echo "$which_out"; | |
else | |
type "$@"; | |
fi | |
} | |
function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; } | |
function vsrssh () { vagrant suspend && vagrant resume $1 && vagrant ssh $1; } | |
# GIT shortcuts | |
alias gb='git branch' | |
alias gba='git branch -a' | |
alias gc='git commit -a -v' | |
alias gd='git diff | mate' | |
alias gl='git pull' | |
alias gp='git push' | |
alias gpp='git pull;git push' | |
alias gppd='git pull origin dev;git push origin dev' | |
alias gst='git status' | |
alias ga='git add . -v' | |
alias gs='git status' | |
alias gco='git checkout' | |
alias gcb='git checkout -b' | |
alias gitrollback='git reset --hard; git clean -f' | |
alias gunadd='git reset HEAD' | |
alias gsu='git fetch upstream && gco master && git merge upstream/master' | |
# git functions | |
function rbr { | |
git checkout $1; | |
git pull origin $1; | |
git checkout $2; | |
git rebase $1; | |
} | |
function mbr { | |
git checkout $1; | |
git merge $2 | |
git push origin $1; | |
git checkout $2; | |
} | |
# Color constants | |
NO_COLOR='\e[0m' #disable colors | |
TXTBLK='\e[0;30m' # Black - Regular | |
TXTRED='\e[0;31m' # Red | |
TXTGRN='\e[0;32m' # Green | |
TXTYLW='\e[0;33m' # Yellow | |
TXTBLU='\e[0;34m' # Blue | |
TXTPUR='\e[0;35m' # Purple | |
TXTCYN='\e[0;36m' # Cyan | |
TXTWHT='\e[0;37m' # White | |
BLDBLK='\e[1;30m' # Black - Bold | |
BLDRED='\e[1;31m' # Red | |
BLDGRN='\e[1;32m' # Green | |
BLDYLW='\e[1;33m' # Yellow | |
BLDBLU='\e[1;34m' # Blue | |
BLDPUR='\e[1;35m' # Purple | |
BLDCYN='\e[1;36m' # Cyan | |
BLDWHT='\e[1;37m' # White | |
UNDBLK='\e[4;30m' # Black - Underline | |
UNDRED='\e[4;31m' # Red | |
UNDGRN='\e[4;32m' # Green | |
UNDYLW='\e[4;33m' # Yellow | |
UNDBLU='\e[4;34m' # Blue | |
UNDPUR='\e[4;35m' # Purple | |
UNDCYN='\e[4;36m' # Cyan | |
UNDWHT='\e[4;37m' # White | |
BAKBLK='\e[40m' # Black - Background | |
BAKRED='\e[41m' # Red | |
BAKGRN='\e[42m' # Green | |
BAKYLW='\e[43m' # Yellow | |
BAKBLU='\e[44m' # Blue | |
BAKPUR='\e[45m' # Purple | |
BAKCYN='\e[46m' # Cyan | |
BAKWHT='\e[47m' # White | |
TXTRST='\e[0m' # Text Reset | |
BRIGHT_RED="\[\033[1;31m\]" | |
DULL_WHITE="\[\033[0;37m\]" | |
BRIGHT_WHITE="\[\033[1;37m\]" | |
#------------------------------------------------------------- | |
# Spelling typos - highly personnal and keyboard-dependent :-) | |
#------------------------------------------------------------- | |
alias xs='cd' | |
alias vf='cd' | |
alias moer='more' | |
alias moew='more' | |
alias kk='ll' | |
export ALTERNATE_EDITOR="" | |
alias emacsclient="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" | |
alias emacs="ec" | |
export EDITOR="et" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment