Skip to content

Instantly share code, notes, and snippets.

@tommymarshall
Created March 23, 2018 14:26
Show Gist options
  • Save tommymarshall/6aa80643c193c8b78c55cb2f519d1d21 to your computer and use it in GitHub Desktop.
Save tommymarshall/6aa80643c193c8b78c55cb2f519d1d21 to your computer and use it in GitHub Desktop.
My Zshrc
# If you come from bash you might have to change your $PATH.
export PATH=./node_modules/.bin:$HOME/bin:$HOME/.composer/vendor/bin:/usr/local/bin:/Users/tmarshall/repos/multitasking/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/tmarshall/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="af-magic"
ZSH_THEME="robbyrussell"
plugins=(git colorize zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
export EDITOR='/usr/local/bin/code'
# Aliases
# Alias List
alias art="php artisan"
alias b="cd ~/repos/reporting"
alias be="bundle exec"
alias becapi="bundle exec cap integration deploy"
alias becapp="bundle exec cap production deploy"
alias becaps="bundle exec cap staging deploy"
alias c="clear"
alias capp="cap production deploy"
alias caps="cap staging deploy"
alias cda="composer dump-autoload"
alias fetch="git fetch"
alias fix="git add . && git commit -m 'wip' && git rebase -i HEAD~2"
alias ga='git add '
alias gaa="git add --all"
alias gb='git branch '
alias gc='git commit'
alias gca="git commit -am"
alias gcb="git checkout"
alias gcs="git add src/* && git ci -m"
alias gd='git diff'
alias get='git '
alias git-pretty="git log --graph --oneline --all --decorate"
alias gk='gitk --all&'
alias gob="git checkout -"
alias got='git '
alias grc="git rebase --continue"
alias gs='git status '
alias gt='git '
alias gx='gitx --all'
alias hgrep="history | grep "
alias log="git log --graph --oneline --all --decorate"
alias mend="git add -A && git commit --amend"
alias mt="multitasking"
alias myip="curl ip.appspot.com"
alias p="gulp"
alias psrfix="php /usr/local/bin/php-cs-fixer"
alias pull="git pull"
alias pullo="git push origin"
alias gpom="git push origin master"
alias push="git push"
alias simpleserver="python -m SimpleHTTPServer 8884"
alias so="subl ."
alias co="code ."
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
alias u="grunt"
alias unstage="git reset HEAD ."
alias y="yarn"
alias yt="yarn test"
alias zshrc="code ~/.zshrc"
alias ytif="yarn test --watch --testPathIgnorePatterns='functional' --testPathPattern"
# Open a Medallia Pull Request
mpr () {
local repo=`git remote -v | grep -m 1 "origin" | sed -e "s/.*github.medallia.com[:/]\(.*\)\.git.*/\1/"`
local branch=`git name-rev --name-only HEAD`
local username=`id -un`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.medallia.com/$repo/compare/master...${username}:$branch?expand=1
}
pr () {
local repo=`git remote -v | grep -m 1 "origin" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
local branch=`git name-rev --name-only HEAD`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.com/$repo/pull/new/$branch
}
# START NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# END NVM
# BEGIN PATH ENTRY FOR QA CLIENTS [knut-style]
[[ -r "/Users/tmarshall/repos/staging/other/commandline" ]] && PATH="$PATH:/Users/tmarshall/repos/staging/other/commandline"
# END PATH ENTRY FOR QA CLIENTS [knut-style]
# BEGIN PATH ENTRY FOR MULTITASKING SCRIPTS [wko-style]
[[ -r "/Users/tmarshall/repos/multitasking/bin" ]] && PATH="$PATH:/Users/tmarshall/repos/multitasking/bin"
# END PATH ENTRY FOR MULTITASKING SCRIPTS [wko-style]
# BEGIN ANSIBLE MANAGED BLOCK [wko-style]
r() {
if [[ "$1" = "-h" || "$1" = "--help" ]]; then
multitasking -h r
else
pushd /Users/tmarshall/repos/"$1"
fi
}
# END ANSIBLE MANAGED BLOCK [wko-style]
source /Users/tmarshall/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment