Skip to content

Instantly share code, notes, and snippets.

@lorenzorapetti
Created April 30, 2021 20:38
Show Gist options
  • Save lorenzorapetti/fb9b9b588067fbd43ef195d25f2b6c3b to your computer and use it in GitHub Desktop.
Save lorenzorapetti/fb9b9b588067fbd43ef195d25f2b6c3b to your computer and use it in GitHub Desktop.
### ZSH Options
zle_highlight+=(paste:none)
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zinit-zsh/z-a-rust \
zinit-zsh/z-a-as-monitor \
zinit-zsh/z-a-patch-dl \
zinit-zsh/z-a-bin-gem-node
### End of Zinit's installer chunk
WORDCHARS='*?_[]~&;!#$%^(){}<>'
export PATH="$HOME/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
export PURE_PROMPT_SYMBOL='λ'
zinit light zsh-users/zsh-autosuggestions
zinit light zdharma/fast-syntax-highlighting
zinit light zdharma/history-search-multi-word
zinit light zsh-users/zsh-history-substring-search
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
zinit light sindresorhus/pure
# z
. /opt/homebrew/etc/profile.d/z.sh
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
### ----------------- ALIASES -----------------
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias /="cd /"
alias ~="cd ~"
# Zsh config
alias reload-zsh="source ~/.zshrc"
alias zshconfig="${EDITOR:-code} ~/.zshrc"
# Basic commands
alias ls="lsd"
alias lla="ls -la"
alias cat="bat"
alias grep="ripgrep"
# Brew
alias b="brew"
alias bi="brew install"
alias bic="brew install --cask"
alias bu="brew update"
alias bo="brew outdated"
# Node
alias nd="npm run dev"
alias ns="npm start"
alias nt="npm test"
alias y="yarn"
alias ys="yarn start"
alias yd="yarn dev"
alias yt="yarn test"
alias yui="yarn upgrade-interactive --latest"
# Git
alias g="git"
alias ga="git add"
alias gaa="git add --all"
alias gc="git commit -v"
alias gp="git push"
alias gst="git status -sb"
alias gs="git switch"
alias gsc="git switch -c"
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
### ----------------- OTHER -----------------
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
iterm2_print_user_vars() {
iterm2_set_user_var rubyVersion $(ruby -v | awk '{ print $2 }')
iterm2_set_user_var nodeVersion $(node -v)
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment