Skip to content

Instantly share code, notes, and snippets.

@trovster
Created December 1, 2020 08:37
Show Gist options
  • Save trovster/81cea20fb5543a220e0af186c4c7933d to your computer and use it in GitHub Desktop.
Save trovster/81cea20fb5543a220e0af186c4c7933d to your computer and use it in GitHub Desktop.
.zshrc config
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/usr/local/opt/libpq/bin:/usr/local/sbin:$PATH"
# Homebrew PHP
export PATH="/usr/local/opt/php@7.4/bin:$PATH"
export PATH="/usr/local/opt/php@7.4/sbin:$PATH"
# Homebrew Python
export PATH=/usr/local/share/python:$PATH
#export PYTHONPATH="/usr/local/lib/python3.7/site-packages:$PYTHONPATH"
# Node Version Manager
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
# Path to your oh-my-zsh installation.
export ZSH="/Users/trovster/.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="agnoster" # agnoster / robbyrussell / powerlevel9k/powerlevel9k
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
osx
git
git-flow
git-extras
textmate
vscode
npm
node
brew
composer
docker
kubectl
wp-cli
)
source $ZSH/oh-my-zsh.sh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# User configuration
DEFAULT_USER=`whoami`
# Exports
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export HOMEBREW_GITHUB_API_TOKEN=""
export GITHUB_TOKEN=""
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
# General
alias cat="bat"
alias brewup="brew update; brew upgrade; brew cleanup --prune-prefix; brew cleanup; brew doctor"
alias ls="ls -la -h -Gp -F"
alias grep="grep -n --color"
alias ping="ping -c 5"
alias cls="clear"
alias gpa="git pushall" # added 'push all' to git aliases
alias md="mkdir -p"
alias gs="git status"
# Config
alias zshconfig="mate ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
alias hostfile="sudo vi /etc/hosts"
alias sshconfig="vi ~/.ssh/config"
# PHP
alias art="php artisan"
alias serve="php artisan serve"
alias phpunit="vendor/bin/phpunit"
alias test="vendor/bin/phpunit -d memory_limit=2048M --testsuite Unit,Feature,Api --colors=always --group="
alias composer="COMPOSER_MEMORY_LIMIT=-1 composer"
# Switch PHP versions
phpv() {
if [ $1 = "7.4" ]; then
valet use php
else
valet use php@$1
fi
sed -in "s/128M/512M/g" /usr/local/etc/php/$1/conf.d/php-memory-limits.ini
composer global update
source ~/.zshrc
}
alias php70="phpv 7.0"
alias php71="phpv 7.1"
alias php72="phpv 7.2"
alias php73="phpv 7.3"
alias php74="phpv 7.4"
# Enable aliases to be sudo’ed
alias sudo='sudo '
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
alias "$method"="lwp-request -m '$method'"
done
eval "$(grunt --completion=zsh)"
# Make sure SSH keys are added
ssh-add -A 2>/dev/null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment