Skip to content

Instantly share code, notes, and snippets.

@remylagerweij
Last active May 2, 2024 05:23
Show Gist options
  • Save remylagerweij/ca3b0a9227b9ce50453f22b2b3de0c01 to your computer and use it in GitHub Desktop.
Save remylagerweij/ca3b0a9227b9ce50453f22b2b3de0c01 to your computer and use it in GitHub Desktop.
zshrc file, aliasses etc.
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/remylagerweij/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard 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=(
git
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# 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`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# REMY
echo -e "\033]6;1;bg;red;brightness;40\a"
echo -e "\033]6;1;bg;green;brightness;44\a"
echo -e "\033]6;1;bg;blue;brightness;52\a"
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
# Auto use NVMRC
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
# source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Export OPENSSL
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
# Export gettext
export PATH="/usr/local/opt/gettext/bin:$PATH"
# export libffi
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
export EDITOR=atom
# / UTILITY COMMANDS / #
eval "$(thefuck --alias)"
alias addalias="atom ~/.zshrc"
alias edithosts="atom /private/etc/hosts"
alias ls="ls -GFh"
alias ll="ls -laG"
alias wijsheid="fortune | cowsay | lolcat"
# / DOCKER COMMANDS / #
alias docker-remove='docker rm $(docker ps -aq) --force'
# / RAILS & POSTGRES COMMANDS / #
alias be="bundle exec"
alias pg="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias newdb="yarn rails db:environment:set RAILS_ENV=development db:drop db:create db:migrate db:seed_fu"
# / GIT COMMANDS / #
alias gga="git add ."
alias ggco="git checkout"
alias ggpush="git push"
alias ggp="git pull --rebase"
alias ggcm="git commit -m"
alias ggs="git status"
alias ggb="git branch"
alias ggf="git fetch"
alias newbranch="git checkout -b"
# / YARN COMMANDS / #
alias y="yarn" # The Yarn command
alias ya="yarn add" # Install a package in dependencies (package.json)
alias yad="yarn add --dev" # Install a package in devDependencies (package.json)
alias yap="yarn add --peer" # Install a package in peerDependencies (package.json)
alias yb="yarn build" # Run the build script defined in package.json
alias ycc="yarn cache clean" # Clean yarn's global cache of packages
alias yga="yarn global add" # Install packages globally on your operating system
alias ygls="yarn global list" # Lists global installed packages
alias ygrm="yarn global remove" # Remove global installed packages from your OS
alias ygu="yarn global upgrade" # Upgrade packages installed globally to their latest version
alias yh="yarn help" # Show help for a yarn command
alias yi="yarn init" # Interactively creates or updates a package.json file
alias yin="yarn install" # Install dependencies defined in package.json
alias yls="yarn list" # List installed packages
alias yout="yarn outdated" # Check for outdated package dependencies
alias yp="yarn pack" # Create a compressed gzip archive of package dependencies
alias yrm="yarn remove" # Remove installed packages
alias yrun="yarn run" # Run a defined package script
alias yse="yarn serve" # Start the dev server
alias ys="yarn start" # Run the start script defined in package.json
alias yt="yarn test" # Run the test script defined in package.json
alias yuc="yarn global upgrade && yarn cache clean" # Upgrade global packages and clean yarn's global cache
alias yui="yarn upgrade-interactive" # Prompt for which outdated packages to upgrade
alias yup="yarn upgrade" #Upgrade packages to their latest version
alias yw="yarn watch" # Run watch command on YARN
alias yr="yarn rails" # Run Rails command on YARN
# / START COMMANDS / #
alias startforeman="foreman start -f Procfile.dev"
# / STANDARD JS COMMANDS / #
alias st="standard --verbose | snazzy"
alias stfix="standard --verbose --fix"
export PATH="$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$PATH:`yarn global bin`"
# export LIBRARY_PATH=/usr/local/Cellar/gsl/1.16/lib/
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fi
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment