Skip to content

Instantly share code, notes, and snippets.

@abl
Last active December 3, 2023 18:41
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save abl/d004dcad84a16ddd670f5337ba5b896d to your computer and use it in GitHub Desktop.
Save abl/d004dcad84a16ddd670f5337ba5b896d to your computer and use it in GitHub Desktop.
abl's universal .zshrc
if [[ -f "/mnt/c/WINDOWS/system32/wsl.exe" ]]; then
# We're in WSL, which defaults to umask 0 and causes issues with compaudit
umask 0022
if [[ "${PWD}" = "/mnt/c/Users/${USER}" ]]; then
# We're in a default WSL shell
cd "${HOME}"
fi
fi
if [[ ! -d "$HOME/.zinit" ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)"
chmod 700 "$HOME/.zinit"
fi
### Added by zinit's installer
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
### End of zinit installer's chunk
zinit ice wait lucid blockf atpull'zinit creinstall -q .'
zinit light zsh-users/zsh-completions
# zdharma/history-search-multi-word
zinit ice wait"1" lucid
zinit load zdharma/history-search-multi-word
zinit ice pick"async.zsh" src"pure.zsh"
zinit light sindresorhus/pure
zinit ice wait lucid blockf atinit'chmod 700 .'
zinit load agkozak/zsh-z
# BurntSushi/ripgrep
zinit ice as"command" from"gh-r" mv"ripgrep* -> rg" pick"rg/rg"
zinit light BurntSushi/ripgrep
# sharkdp/fd
zinit ice as"command" from"gh-r" mv"fd* -> fd" pick"fd/fd"
zinit light sharkdp/fd
# sharkdp/bat
zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat"
zinit light sharkdp/bat
# dandavision/delta
zinit ice as"command" from"gh-r" mv"delta* -> delta" pick"delta/delta"
zinit light dandavison/delta
# Configure as default git diff renderer
git config --global core.pager "delta --dark"
# ogham/exa, replacement for ls
zinit ice wait"2" lucid from"gh-r" as"program" mv"exa* -> exa"
zinit light ogham/exa
# direnv
zinit ice from"gh-r" as"program" mv"direnv* -> direnv"
zinit light direnv/direnv
# pyenv
zinit ice atclone"./libexec/pyenv init - > zpyenv.zsh" \
atinit'export PYENV_ROOT="$PWD"' atpull"%atclone" \
as'command' pick'bin/pyenv' src"zpyenv.zsh" nocompile'!'
zinit light pyenv/pyenv
# fzf
zinit ice from"gh-r" as"program"
zinit light junegunn/fzf-bin
# forgit
zinit ice wait lucid
zinit load 'wfxr/forgit'
# zsh-startify, a vim-startify like plugin
zinit ice wait"0" lucid atload"zsh-startify"
zinit load zdharma/zsh-startify
# zsh-autopair
zinit ice wait lucid
zinit load hlissner/zsh-autopair
# Gitignore plugin – commands gii and gi
zinit ice wait"2" lucid
zinit load voronkovich/gitignore.plugin.zsh
# Autosuggestions & fast-syntax-highlighting
zinit ice wait"1" lucid atinit"zpcompinit; zpcdreplay" atload"FAST_HIGHLIGHT[chroma-git]=\"chroma/-ogit.ch\""
zinit light zdharma/fast-syntax-highlighting
# zsh-autosuggestions
zinit ice wait"1" lucid atload"!_zsh_autosuggest_start"
zinit load zsh-users/zsh-autosuggestions
PATH=${PATH}:"${HOME}/.local/bin"
# Nix
if [[ -f "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]]; then
source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
fi
alias ls=exa
alias cat=bat
alias less=bat
alias more=bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment