Last active
February 24, 2017 14:44
-
-
Save danthegoodman/4c25c3a2e94ca3970587 to your computer and use it in GitHub Desktop.
profile.sh
This file contains hidden or 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
###### Environment Configuration | |
export GREP_OPTIONS='--color=auto' | |
export GRAILS_OPTS='-Djava.awt.headless=true -server -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+UseCompressedOops' | |
export GRADLE_OPTS='-Dorg.gradle.daemon=false' | |
export HOMEBREW_CASK_OPTS='--appdir=~/Applications/casks' | |
export PGUSER='ids_dev' | |
export CLICOLOR=1 | |
export LESS='--quit-if-one-screen --RAW-CONTROL-CHARS --no-init --tabs=4' | |
export LS_COLORS=GxFxCxDxBxegedabagaced | |
export TREE_COLORS='di=1;36:ln=1;35:so=1;32:pi=1;33:ex=1;31:bd=34;46:cd=34;33:fi=0:or=4;31' | |
export LSCOLORS=$LS_COLORS | |
export IDS_REGISTER_WITH_IDS_PROXY=true | |
###### Bash configuration | |
PROMPT_DIRTRIM=5 | |
PS1='\[\033[0;31m\]${PS1_AWS_PROFILE}\[\033[0m\]\w⚡ ' | |
export HISTCONTROL="ignoredups" | |
# Fix minor typos for various commands | |
shopt -s cdspell | |
shopt -s dirspell | |
# Check window size after each command | |
shopt -s checkwinsize | |
# Include hidden files when globbing | |
shopt -s dotglob | |
# '**' will match all files and zero or more dirs and subdirs | |
# '**/' will match only dirs and subdirs | |
shopt -s globstar | |
# Append history items instead of overwriting file | |
shopt -s histappend | |
# Don't bother completing on an empty line | |
shopt -s no_empty_cmd_completion | |
###### Functions | |
iterm_profile() { echo -e '\033]50;SetProfile='$1'\a' ; } | |
color_ssh() { iterm_profile Remote ; ssh $@ ; iterm_profile Default ; } | |
alert() { echo -e $'\e]9;'${@}'\007' ; echo -e '\033]50;RequestAttention=false\a' ; } | |
bounce() { echo -e '\033]50;RequestAttention=true\a' ; } | |
pg(){ | |
[ -z "$1" ] && echo 'ps aux | grep <argument_required>' || ps aux | grep $1 | |
} | |
mk(){ | |
if [[ -e gradlew ]]; then | |
./gradlew $@ | |
elif [[ -e mk ]]; then | |
./mk $@ | |
else | |
gradle $@ | |
fi | |
} | |
creds(){ | |
local prof; | |
case "$1" in | |
prod) | |
prof=default; | |
PS1_AWS_PROFILE='prod '; | |
;; | |
dev) | |
prof=idsdev; | |
PS1_AWS_PROFILE=''; | |
;; | |
*) | |
echo "Expected either 'dev' or 'prod'" | |
return;; | |
esac | |
export AWS_PROFILE=${prof} | |
} | |
creds dev | |
j6() { | |
export JAVA_HOME=/Library/Java/Home | |
} | |
j7() { | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7/Contents/Home | |
} | |
j8() { | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home | |
} | |
####### Aliases | |
alias ssh='color_ssh' | |
alias ls='ls -G' | |
alias ant='ant -lib ~/prog/ant-tools/ant-tools.jar -logger us.kirchmeier.tools.QuietLogger' | |
alias gk='gitk --all' | |
alias gks='gitk --all --simplify-by-decoration' | |
alias g='git' | |
alias gst='git status -sb' | |
####### Environment Paths | |
export JAVA_6_HOME=/Library/Java/Home | |
export JAVA_7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7/Contents/Home | |
export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home | |
j8 | |
export GWT_HOME=~/lib/gwt | |
export PATH=~/bin:\ | |
~/etc/depot_tools:\ | |
~/.nimble/bin:\ | |
/usr/local/bin:\ | |
~/.pub-cache/bin:\ | |
$PATH | |
if [ -f /usr/local/share/bash-completion/bash_completion ]; then | |
. /usr/local/share/bash-completion/bash_completion | |
fi | |
complete -C aws_completer aws | |
. /usr/local/etc/bash_completion.d/git-completion.bash | |
__git_complete g __git_main | |
export SDKMAN_DIR=~/.sdkman | |
[[ -s "/Users/danny/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/danny/.sdkman/bin/sdkman-init.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment