Skip to content

Instantly share code, notes, and snippets.

Last active Sep 2, 2021
What would you like to do?
My .zshrc
# source ASDF
source $HOME/.asdf/
# source ZSH autosuggestions
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
fpath=(${HOME}/.zsh.d/ $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit
# system-wide aliases
alias cd='pushd'
alias back='popd'
alias vi='vim'
alias yay='yay --aur'
alias restart-plasma='kquitapp5 plasmashell && kstart5 plasmashell > /dev/null 2>&1'
# docker aliases
alias dps='docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"'
alias es-run='docker run --name es-docker -e "discovery.type=single-node" -e "ES_JAVA_OPTS=-Xms2g -Xmx2g" --net elastic -d -p 9200:9200 -p 9300:9300 -v $HOME/docker/volumes/elasticsearch:/usr/share/elasticsearch/data'
alias es-rm='docker rm es-docker'
alias es-start='docker start es-docker'
alias es-stop='docker stop es-docker'
alias es-status='docker ps --filter name=es-docker'
alias kib-run='docker run --name kib-docker -e "ELASTICSEARCH_HOSTS=http://es-docker:9200" --net elastic -d -p 5601:5601'
alias kib-rm='docker rm kib-docker'
alias kib-start='docker start kib-docker'
alias kib-stop='docker stop kib-docker'
alias kib-status='docker ps --filter name=kib-docker'
alias redis-run='docker run --name redis-docker -d -p 6379:6379 -v $HOME/docker/volumes/redis:/data redis'
alias redis-rm='docker rm redis-docker'
alias redis-start='docker start redis-docker'
alias redis-stop='docker stop redis-docker'
alias redis-status='docker ps --filter name=redis-docker'
alias pg-run='docker run --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres'
alias pg-rm='docker rm pg-docker'
alias pg-start='docker start pg-docker'
alias pg-stop='docker stop pg-docker'
alias pg-status='docker ps --filter name=pg-docker'
alias mysql-run='docker run --name mysql-docker -e MYSQL_ROOT_PASSWORD=docker -d -p 3306:3306 -v $HOME/docker/volumes/mysql:/var/lib/mysql mysql'
alias mysql-rm='docker rm mysql-docker'
alias mysql-start='docker start mysql-docker'
alias mysql-stop='docker stop mysql-docker'
alias mysql-status='docker ps --filter name=mysql-docker'
alias mysql5-run='docker run --name mysql-5.7.33-docker -e MYSQL_ROOT_PASSWORD=docker -d -p 3306:3306 -v $HOME/docker/volumes/mysql-5.7.33:/var/lib/mysql mysql:5.7.33'
alias mysql5-rm='docker rm mysql-5.7.33-docker'
alias mysql5-start='docker start mysql-5.7.33-docker'
alias mysql5-stop='docker stop mysql-5.7.33-docker'
alias mysql5-status='docker ps --filter name=mysql-5.7.33-docker'
# ruby aliases
alias be='bundle exec'
alias brs='be rails s'
alias brc='be rails c'
alias brcp='be rails c -e production'
alias bspec='be rspec'
# source Prezto
source $HOME/.zprezto/runcoms/zshrc
# source each YADR ZSH config
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
# Tilix fix
if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
source /etc/profile.d/
# dotnet tools
export PATH="$PATH:$HOME/.dotnet/tools"
# zsh parameter completion for the dotnet CLI
local completions=("$(dotnet complete "$words")")
reply=( "${(ps:\n:)completions}" )
compctl -K _dotnet_zsh_complete dotnet
# Prompt
prompt steeef
# Android SDK
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export ANDROID_HOME=$HOME/Android/Sdk
# avdmanager, sdkmanager
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
# adb, logcat
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
# emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
# Ruby bundler default editor
export BUNDLER_EDITOR=code
# rubocop-daemon
export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH"
# iex REPL history
export ERL_AFLAGS='-kernel shell_history enabled'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment