Skip to content

Instantly share code, notes, and snippets.

@dingo-d

dingo-d/.zshrc

Created May 22, 2021
Embed
What would you like to do?
My default .zshrc config
# If you come from bash you might have to change your $PATH.
ZSH_DISABLE_COMPFIX=true
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.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"
# Zsh plugins
# https://github.com/unixorn/awesome-zsh-plugins#plugins
# https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
plugins=(
git
gitfast
docker
wp-cli
)
source $ZSH/oh-my-zsh.sh
# User configuration
export PATH=/usr/local/bin:$PATH
export PATH="/usr/local/sbin:$PATH"
export PATH="$PATH:$HOME/.composer/vendor/bin"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Highlight
alias highlight="pbpaste | highlight --syntax=js --style=Moria --font-size=30 --font=Input\ Mono --replace-tabs=2 -O rtf | pbcopy"
alias ll="exa --long --header --git"
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias zshconfig="mate ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
# Dir: current working directory
prompt_dir() {
prompt_segment blue black "%$(( $COLUMNS - 61 ))<...<%3~%<<"
}
# Composer aliases
alias cda="composer -o dump-autoload"
alias ci="composer install"
alias cu="composer update"
alias compProd="composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader"
# PHP Documentor
alias phpdoc="php /usr/local/bin/phpDocumentor.phar"
# SVG Optimization
alias svgall='for i in *.svg; do svgo "$i"; done'
# Docker
alias dpsa="docker ps --all"
alias dima="docker images --all"
alias drm="docker rm"
alias drmi="docker rmi"
alias dsp="docker system prune"
alias dcu="docker-compose up"
alias dcr="docker-compose rm"
alias dc="docker-compose"
alias ds="docker stop"
alias dst="docker start"
alias dn="docker network"
alias dv="docker volume"
alias dr="docker restart"
alias dl="docker logs"
alias de="docker exec"
# Git
alias prune-branches="git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d"
# Symfony shortcuts
alias console="php bin/console"
# Nano
alias nano="/usr/local/bin/nano"
# gpg fix
export GPG_TTY=$(tty)
# Ruby
export PATH="/usr/local/opt/ruby/bin:$PATH"
# Python
alias python='/usr/bin/python3'
# WP-CLI site setup
# Usage create-site {folder name} {database name} {site title}
create-site () {
mkdir $1 && cd $1
wp core download --skip-content
wp config create --dbname=$2 --dbuser=root
valet link && valet secure
(
wp db create || true
wp core install --url="$1"".test" --title=$3 --admin_user=admin --admin_password=password --admin_email=admin@sitetitle.com
)
}
# Deployer
source ~/.deployer_completion
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment