Skip to content

Instantly share code, notes, and snippets.

@imcodingideas
Created February 20, 2020 23:50
Show Gist options
  • Save imcodingideas/f441d421e72e5ab31ca0fb8796c87031 to your computer and use it in GitHub Desktop.
Save imcodingideas/f441d421e72e5ab31ca0fb8796c87031 to your computer and use it in GitHub Desktop.
export ZSH="/Users/jchambers/.oh-my-zsh"
ZSH_THEME="spaceship"
plugins=(git docker zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# User configuration
alias h='cd ~/'
alias ll='ls -FGlAhp'
alias zs="source ~/.zshrc"
alias gum="git pull upstream master"
gac() { git add . && git commit -m "$*" }
gaf() { git add . && git commit -am "fixup! $*" }
alias dsclean='find . -type f -name .DS_Store -print0 | xargs -0 rm'
# Find and kill port. i.e. kp 3000
function kp() { lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 }
# Get macOS Software Updates, and update installed Homebrew, npm, and their installed packages
alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm install npm -g; npm update -g'
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
elif [[ $(nvm version) != $(nvm version default) ]]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# Move next only if `homebrew` is installed
if command -v brew >/dev/null 2>&1; then
[ -f $(brew --prefix)/etc/profile.d/z.sh ] && source $(brew --prefix)/etc/profile.d/z.sh
fi
function openall() {
for folder in */; do code $folder; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment