Skip to content

Instantly share code, notes, and snippets.

@thomasvds

thomasvds/.zshrc Secret

Created January 11, 2022 06:46
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 thomasvds/72492551ed4c8d1dd701d1e61179b0ab to your computer and use it in GitHub Desktop.
Save thomasvds/72492551ed4c8d1dd701d1e61179b0ab to your computer and use it in GitHub Desktop.
export ZSH=/Users/thomasvanderstraeten/.oh-my-zsh
ZSH_THEME="agnoster"
ZSH_DISABLE_COMPFIX=true
plugins=(git bundler osx common-aliases history-substring-search zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# ACTIONS
alias glean="git fetch && gswp && git-clean-local-branches"
alias gst="git status"
alias gplm="git pull origin master"
alias gswp="git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d"
alias unshite="find . -name '*.DS_Store' -type f -delete"
alias pkglambda="zip -r ../lambda.zip ./*"
alias dev="yarn dev"
alias tunnel="yarn dev:tunnel"
alias dcu="docker-compose up"
alias dcub="docker-compose up --build"
alias uuidgen='uuidgen | tr "[:upper:]" "[:lower:]"'
# REPOS
alias landing="cd ~/code/canyon/landing"
alias portal="cd ~/code/canyon/portal"
alias chub="cd ~/code/canyon/hub"
alias ops="cd ~/code/canyon/legalops"
alias cdkb="cd ~/code/canyon/aws-cdk-back"
alias cdkf="cd ~/code/canyon/aws-cdk-front"
alias sless="cd ~/code/canyon/serverless"
gps() {
git push origin $(git branch | grep \* | cut -d ' ' -f2-)
}
gpl() {
git pull origin $(git branch | grep \* | cut -d ' ' -f2-)
}
git-clean-local-branches () {
# Remove all local branches for which the remote has been deleted
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
}
pr() {
# Prerequisites:
# - brew install hub
# - hub browser
# Save current branch name
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2-)
# Check out from current branch to new branch
git checkout -b $1
# Create empty commit to allow opening a PR
git commit --allow-empty -m "Create branch"
# Push the new branch and open a PR against the current branch, with branch name as PR title
hub pull-request --push --base $CURRENT_BRANCH --message $1
}
DEFAULT_USER=$USER
prompt_context() {
emojis=("โšก๏ธ" "๐Ÿ”ฅ" "๐Ÿ’€" "๐Ÿ‘‘" "๐Ÿ˜Ž" "๐Ÿธ" "๐Ÿต" "๐Ÿฆ„" "๐ŸŒˆ" "๐Ÿป" "๐Ÿš€" "๐Ÿ’ก" "๐ŸŽ‰" "๐Ÿ”‘" "๐Ÿšฆ" "๐ŸŒ™" "๐ŸŽ‰" "๐ŸŒฎ" "๐Ÿ’ƒ")
RAND_EMOJI_N=$(( $RANDOM % ${#emojis[@]} + 1))
prompt_segment black default "${emojis[$RAND_EMOJI_N]} "
}
PATH=$PATH:/usr/local/sbin
RPS1="SHIP OR DIE"
GOPATH=$HOME/go
GOBIN=$GOPATH/bin
PATH=${PATH}:$GOBIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment