Skip to content

Instantly share code, notes, and snippets.

@bycassius
Last active July 10, 2023 11:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bycassius/99ada9aee71fc3125191 to your computer and use it in GitHub Desktop.
Save bycassius/99ada9aee71fc3125191 to your computer and use it in GitHub Desktop.
ZSHRC (Oh My ZSH)
# ██
# ░██
# ██████ ██████░██ ██████ █████
# ░░░░██ ██░░░░ ░██████ ░░██░░█ ██░░░██
# ██ ░░█████ ░██░░░██ ░██ ░ ░██ ░░
# ██ ░░░░░██░██ ░██ ░██ ░██ ██
# ██████ ██████ ░██ ░██░███ ░░█████
# ░░░░░░ ░░░░░░ ░░ ░░ ░░░ ░░░░░
#
# PATHS
export PATH=$HOME/bin:/usr/local/bin:$PATH
# export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export ZSH="$HOME/.oh-my-zsh"
# export PATH="/opt/homebrew/opt/curl/bin:$PATH"
# Themes
ZSH_THEME="headline"
# ZSH_THEME="pygmalion"
# ZSH_THEME="muse"
# ZSH_THEME="cloud"
# ZSH_THEME="ys"
# ZSH_THEME="mikeh"
# ZSH_THEME="jnrowe"
# ZSH_THEME="hyperzsh"
# ZSH_THEME="kphoen"
# ZSH_THEME="mrtazz"
# ZSH_THEME="gallois"
# ZSH_THEME="mortalscumbag"
# ZSH_THEME="jonathan"
# ZSH_THEME="takashiyoshida"
# ZSH_THEME="terminalparty"
# ZSH_THEME="edvardm"
# ZSH_THEME="nt9"
# ZSH_THEME="sunrise"
# ZSH_THEME="honukai"
# ZSH_THEME="bureau"
# ZSH_THEME="wezm"
# ZSH_THEME="wezm+"
# ZSH_THEME="bira"
# ZSH_THEME="miloshadzic"
# ZSH_THEME="xiong-chiamiov-plus"
# ZSH_THEME="nanotech"
# ZSH_THEME="smt"
# ZSH_THEME="agnoster"
# ZSH_THEME="nebirhos"
# ZSH_THEME="rkj-repos"
ZSH_COLORIZE_STYLE="colorful"
# zstyle ':omz:update' mode disabled
zstyle ':omz:update' mode auto
# zstyle ':omz:update' mode reminder
zstyle ':omz:update' frequency 7
# Terminal
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="dd.mm.yyyy"
# Syntax Highlighting
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
# Colors
autoload -U colors && colors
# PS1="%B%{$fg[magenta]%}➜ %{$fg[yellow]%}[%{$fg[blue]%}%c%{$fg[yellow]%}] %{$fg[magenta]%}✗%{$reset_color%}%b "
# PS1="%B%{$fg[magenta]%}➜ %{$fg[blue]%}%c%{$fg[magenta]%} ✗%{$reset_color%}%b "
# PS1=" %B%{$fg[blue]%}%c %{$fg[yellow]%}>%{$fg[red]%}>%{$fg[magenta]%}>%{$reset_color%}%b "
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats ' %b'
setopt PROMPT_SUBST
PROMPT=' %B%{$fg[blue]%}%c %{$fg[yellow]%}>%{$fg[red]%}>%{$fg[magenta]%}>%{$fg[cyan]%}${vcs_info_msg_0_}%b '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Display how long all tasks over 10 seconds take
export REPORTTIME=10
export KEYTIMEOUT=1 # 10ms delay for key sequences
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt EXTENDED_HISTORY # write the history file in the ":start:elapsed;command" format.
setopt HIST_REDUCE_BLANKS # remove superfluous blanks before recording entry.
setopt SHARE_HISTORY # share history between all sessions.
setopt HIST_IGNORE_ALL_DUPS # delete old recorded entry if new entry is a duplicate.
# Basic auto/tab complete:
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
# Plugins
plugins=(
sudo
git
dotenv
macos
vscode
history
command-not-found
copypath
cp
thefuck
colorize
zsh-autosuggestions
zsh-syntax-highlighting
safe-paste
systemadmin
aliases
)
source $ZSH/oh-my-zsh.sh
# Config
export MANPATH="/usr/local/man:$MANPATH"
export LANG=en_US.UTF-8
# M1 Architecture
# https://devot.team/blog/how-to-install-unsupported-development-software-on-m1-mac
if [ "$(uname -p)" = "i386" ]; then
echo "Running Intel via Rosetta"
eval "$(/usr/local/homebrew/bin/brew shellenv)"
alias brew='/usr/local/homebrew/bin/brew'
else
echo "Running M1 Silicon ARM64"
eval "$(/opt/homebrew/bin/brew shellenv)"
alias brew='/opt/homebrew/bin/brew'
fi
# Editor
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='nano'
# else
# export EDITOR='vim'
# fi
export EDITOR='nvim'
export GIT_EDITOR='nvim'
# Flags
export ARCHFLAGS="-arch x86_64"
# Aliases
alias ezsh="code ~/.zshrc"
alias szsh="source ~/.zshrc"
alias bo="brew outdated"
alias bu="brew update && brew upgrade"
alias bd="brew doctor"
alias bi="brew install"
alias bs="brew search --desc --eval-all"
alias rundev="npm run dev --host"
alias archarm="arch -arm64 zsh"
alias archint="arch -x86_64 zsh"
alias python="/usr/local/bin/python3"
#confirm before doing something bad
alias cp="cp -i" # confirm before overwriting something
alias rm="rm -i"
alias mv="mv -i"
alias df="df -h" # human-readable sizes
alias free="free -m" # show sizes in MB
alias more="less"
alias q="exit"
alias c="clear"
alias hist="history"
alias cs="clear; ls"
# alias ls="exa -l"
alias grep="grep --color=auto"
# alias la="exa -a"
# alias l="la -l"
alias l="ls -la"
alias home="cd ~ && l"
alias root="cd / && l"
alias proj="cd ~/Projects/Sandbox/ && l"
alias ..="cd .. && l"
alias ...="cd ..; cd .. && l"
alias ....="cd ..; cd ..; cd .. && l"
# git
alias addup='git add -u'
alias addall='git add .'
alias branch='git branch'
alias checkout='git checkout'
alias clone='git clone'
alias commit='git commit -m'
alias fetch='git fetch'
alias pull='git pull origin'
alias push='git push origin'
alias stat='git status' # 'status' is protected name so using 'stat' instead
alias tag='git tag'
alias newtag='git tag -a'
alias ineovim='git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim'
alias dneovim='rm -rf ~/.config/nvim && rm -rf ~/.local/share/nvim'
alias dsdel='find . -name .DS_Store -delete'
alias dsdeep='find / -name ".DS_Store" -depth -exec rm {} \;'
alias ibrew='arch -x86_64 /usr/local/bin/brew'
eval $(thefuck --alias)
export PATH="/opt/homebrew/opt/ssh-copy-id/bin:$PATH"
export PATH="/opt/homebrew/opt/avr-gcc@8/bin:$PATH"
export PATH="/usr/local/mysql/bin:$PATH"
export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"
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