Skip to content

Instantly share code, notes, and snippets.

@Akahadaka
Last active October 24, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akahadaka/9690eb85040ab44f4fcb to your computer and use it in GitHub Desktop.
Save Akahadaka/9690eb85040ab44f4fcb to your computer and use it in GitHub Desktop.
Default UNIX bash profile supporting GIT colours and GIT-flow alias'
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH
#Vagrant
export VAGRANT_DEFAULT_PROVIDER=parallels
# Git
export PATH=$PATH:/usr/local/Cellar/git
# Yarn Package Installer
export PATH="$PATH:$(yarn global bin)"
export SASS_BINARY_PATH="$HOME/.yarn/offline-cache/darwin-x64-57_binding.node"
# Java
export JAVA_HOME=$(/usr/libexec/java_home)
# Android SDK path
export ANDROID_HOME=/Users/andrew/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
# Add RVM to PATH for scripting
export PATH="$PATH:$HOME/.rvm/bin"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Composer | Laravel
export PATH="$PATH:$HOME/.composer/vendor/bin"
# Bash completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Advanced bash history
export HH_CONFIG=hicolor # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # mem/file sync
# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh \C-j"'; fi
# Git prompt colours
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
export TERM="xterm-color"
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\e[0;33m\]\u@\h:\[\e[0m\]\W\[\e[0;32m\]$(__git_ps1)\[\e[0m\]$ '
# Default Ctrl+r reverse lookup
# Now add Ctrl+s forward lookup
[[ $- == *i* ]] && stty -ixon
# ALIAS
# git flow feature set
gffs() { git flow feature start "$1" && git flow publish "$1"; }
gffc() { git flow feature checkout "$1" && git rebase develop; }
# Don't delete local feature branch
gffk() { git flow feature finish -k "$1"; }
gfft() { git flow feature track "$1"; }
gffp() { git flow feature pull origin "$1"; }
# Always push to the final branch (remote)
gfff() { git flow feature finish "$1" && git push; }
# git flow release set
# Optionally provide a base commit sha-1 hash to start release from
gfrs() { git flow release start "$1" "$2" && git flow release publish "$1"; }
gfrt() { git flow release track "$1"; }
# Alwlays push tags after a release
gfrf() { git flow release finish "$1" && git push --tags; }
# git flow hotfix set
# Optionally provide a basename to start from along with the version
gfhs() { git flow hotfix start "$1" "$2"; }
gfhf() { git flow hotfix finish "$1"; }
# docker telerik nativescript
# tns() { docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb -v $PWD:/src nativescript; }
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
###-tns-completion-start-###
if [ -f /Users/andrew/.tnsrc ]; then
source /Users/andrew/.tnsrc
fi
###-tns-completion-end-###
# iTerm-o-cil iTerm2 windows/panes arrangement
ic() { itermocil "$1" "$2"; }
ice() { nvim ~/.itermocil/"$1".yml; }
# Programatically fix typos in the command line
eval "$(thefuck --alias)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment