Skip to content

Instantly share code, notes, and snippets.

@taymoork2
Last active May 1, 2023 20:21
Show Gist options
  • Save taymoork2/65e375a6ad7ca04cd92b306a158c28e3 to your computer and use it in GitHub Desktop.
Save taymoork2/65e375a6ad7ca04cd92b306a158c28e3 to your computer and use it in GitHub Desktop.
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/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 \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
# oh-my-zsh
function omzPlugin() {
zinit ice svn lucid $2
zinit snippet OMZP::$1
}
function omzLib() {
zinit wait'!' lucid for OMZL::$1
}
### Update ZINIT
zinit self-update
# zinit update --all --parallel --quiet
# OH-MY-ZSH libs
omzLib completion.zsh
omzLib correction.zsh
omzLib directories.zsh
omzLib git.zsh
omzLib grep.zsh
omzLib history.zsh
omzLib key-bindings.zsh
omzLib completion.zsh
# omzLib termsupport.zsh
## OH-MY-ZSH plugins
# MacOS
if [[ `uname` == "Darwin" ]]; then
omzPlugin macos
fi
# system
omzPlugin iterm2
omzPlugin ssh-agent
omzPlugin sudo
omzPlugin cp
omzPlugin rsync wait"1"
omzPlugin gpg-agent
# git
omzPlugin git
omzPlugin git-flow wait"1"
omzPlugin github wait"1"
# node
omzPlugin node wait"1"
omzPlugin yarn wait"1"
omzPlugin nvm wait"1"
# python
omzPlugin python wait"1"
# omzPlugin pyenv wait"1"
omzPlugin pipenv wait"1"
# java
omzPlugin jenv wait"1"
# ruby
omzPlugin rvm wait"1"
# docker
omzPlugin docker wait"1"
# httpie
# omzPlugin httpie wait"1"
# zsh
omzPlugin z
omzPlugin fasd
omzPlugin fzf
omzPlugin asdf wait"1"
omzPlugin command-not-found wait"1"
omzPlugin common-aliases
omzPlugin compleat wait"1"
omzPlugin colorize wait"1"
# omzPlugin per-directory-history wait"1"
##
### PLUGINS
# git-extras
zinit ice as"program" pick"$ZPFX/bin/git-*" make"PREFIX=$ZPFX"
zinit light tj/git-extras
# direnv
zinit ice as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \
atpull'%atclone' pick"direnv" src"zhook.zsh"
zinit light direnv/direnv
# enhancd
zinit ice as"program" pick"init.zsh" wait"2" lucid
zinit light b4b4r07/enhancd
# diff-so-fancy
zinit ice as"program" pick"bin/git-dsf" wait"2" lucid
zinit light zdharma-continuum/zsh-diff-so-fancy
# pyenv
zplugin lucid as'command' pick'bin/pyenv' atinit'export PYENV_ROOT="$PWD"' \
atclone'PYENV_ROOT="$PWD" ./libexec/pyenv init - > zpyenv.zsh' \
atpull"%atclone" src"zpyenv.zsh" nocompile'!' for \
pyenv/pyenv
# nvm
if ! [ -f .nvmrc ]; then export NVM_NO_USE=true; zinit ice wait"0" lucid; fi
export NVM_AUTO_USE=true
zinit light lukechilds/zsh-nvm
# better-npm
zinit ice wait"1" lucid
zinit light lukechilds/zsh-better-npm-completion
# tab-title
zinit ice wait"1" lucid
zinit light trystan2k/zsh-tab-title
ZSH_TAB_TITLE_ONLY_FOLDER=true
ZSH_TAB_TITLE_ADDITIONAL_TERMS='alacritty'
# fzf-fasd
zinit ice wait"1" lucid
zinit light wookayin/fzf-fasd
# navi
zinit ice wait"1" lucid
zinit light denisidoro/navi
# thefuck
zinit ice wait"1" lucid
zinit light laggardkernel/zsh-thefuck
# Autosuggestions & fast-syntax-highlighting
# zinit ice wait lucid atinit"zpcompinit; zpcdreplay"
# zinit light z-shell/F-Sy-H
# unset 'FAST_HIGHLIGHT[chroma-whatis]' 'FAST_HIGHLIGHT[chroma-man]'
zinit wait lucid light-mode for \
atinit"zicompinit; zicdreplay" \
z-shell/F-Sy-H \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
# zsh-autosuggestions
# zinit ice wait lucid atload"_zsh_autosuggest_start"
# zinit light zsh-users/zsh-autosuggestions
# This is a clean-room implementation of the Fish shell's history search feature
zinit light zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# zdharma-continuum/history-search-multi-word. ctrl + r
zinit ice wait"1" lucid
zinit load zdharma-continuum/history-search-multi-word
###
autoload -Uz compinit
compinit
zinit cdreplay -q # <- execute compdefs provided by rest of plugins
zinit cdlist # look at gathered compdefs
### OH-MY-ZSH carry-over
autoload -Uz is-at-least
# ls colors
autoload -U colors && colors
### ENVIRONMENT VARIABLES
export BAT_CONFIG_PATH=~/bat.conf
export LSCOLORS="Gxfxcxdxbxegedabagacad"
### Homebrew requires this
export PATH="/usr/local/sbin:$PATH"
# Set Default EDITOR to neovim
EDITOR='nvim'
### ALIASES
alias cat=ccat
alias vim=nvim
### UNALIAS
# unalias rails `sc` for saucelabs
# unalias sc
### ZSH Settings
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
setopt hist_ignore_all_dups # remove older duplicate entries from history
setopt hist_reduce_blanks # remove superfluous blanks from history items
setopt inc_append_history # save history entries as soon as they are entered
setopt share_history # share history between different instances of the shell
setopt auto_list # automatically list choices on ambiguous completion
setopt auto_menu # automatically use menu completion
setopt auto_cd
setopt multios
setopt prompt_subst
unsetopt correct_all
setopt interactive_comments # allow comments in interactive shells
ZSH_AUTOSUGGEST_USE_ASYNC=true
MATCH_PREV_CM=true
COMPLETION_WAITING_DOTS="true"
# ENABLE_CORRECTION="true"
# 1Password
OP_BIOMETRIC_UNLOCK_ENABLED=true
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# n
# export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
# Bun
[ -s "/Users/taykhan/.bun/_bun" ] && source "/Users/taykhan/.bun/_bun"
export BUN_INSTALL="/Users/taykhan/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# pnpm
export PNPM_HOME="/Users/taykhan/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# tabtab source for packages
[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true
### CLEAR
clear
### Set Starship as the theme - LAST ITEM!!!
eval "$(starship init zsh)"
# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment