Skip to content

Instantly share code, notes, and snippets.

@kevincolten
Last active August 29, 2019 17: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 kevincolten/e4b3158fe4f72227856e to your computer and use it in GitHub Desktop.
Save kevincolten/e4b3158fe4f72227856e to your computer and use it in GitHub Desktop.
gclean.sh: Figure out the default branch on GitHub and remove merged branches locally and remotely. killPort.sh: Pass in a port number and close process living on that port.
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH="/usr/local/miniconda3/bin:$PATH"
export OPENSSL_CONF="/System/Library/OpenSSL/openssl.cnf"
export PATH="/usr/local/bin:$PATH"
export PATH="/Applications/MAMP/bin/php/php7.1.8/bin:$PATH"
export HOMEBREW_BREWFILE=~/Dropbox/Brewfile
export PATH="/usr/local/opt/curl/bin:$PATH"
#export PATH="~/Code/COLLADA2GLTF/cmake_temp/bin/Release:$PATH"
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
if [ -f /usr/local/share/gitprompt.sh ]; then
GIT_PROMPT_THEME=Default
. /usr/local/share/gitprompt.sh
fi
if [ -f $(brew --prefix)/etc/brew-wrap ]; then
source $(brew --prefix)/etc/brew-wrap
fi
if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
fi
hist import
# Turn every directory in ~/Code into an alias
for f in $(ls ~/Code); do alias "$f"="cd ~/Code/$f && . ~/Code/bash-scripts/tab.sh" ; done
. ~/Code/bash-scripts/cd.sh
. ~/Code/bash-scripts/tab.sh
# . ~/Code/bash-scripts/navigate.sh
# aliases
alias ga='git add'
__git_complete ga _git_add
alias gaa='git add -A'
alias gb='git branch'
__git_complete gb _git_branch
alias gcm='git commit -m'
alias gco='git checkout'
__git_complete gco _git_checkout
alias gcb='git checkout -b'
alias gstat='git status'
alias ggpull="git fetch origin"
alias ggpush="git push origin"
alias gm='git merge'
__git_complete gm _git_merge
alias gundo="git reset --soft 'HEAD^'"
cd() {
if [[ -z "$1" ]]; then CD="$HOME"; else CD=$1; fi
builtin cd "$CD"
. ~/Code/bash-scripts/tab.sh
}
function echo_color() {
local color="$1"
printf "${color}$2\033[0m\n"
}
echo_color "\033[0;90m" "ctrl-f Move forward"
echo_color "\033[0;90m" "ctrl-b Move backward"
echo_color "\033[0;90m" "ctrl-p Move up"
echo_color "\033[0;90m" "ctrl-n Move down"
echo_color "\033[0;90m" "ctrl-a Jump to beginning of line"
echo_color "\033[0;90m" "ctrl-e Jump to end of line"
echo_color "\033[0;90m" "ctrl-d Delete forward"
echo_color "\033[0;90m" "ctrl-h Delete backward"
echo_color "\033[0;90m" "ctrl-k Delete forward to end of line"
echo_color "\033[0;90m" "ctrl-u Delete entire line"
tabset --badge -title '\(session.path)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment