Skip to content

Instantly share code, notes, and snippets.

@simics-ja
Last active June 23, 2022 02:37
Show Gist options
  • Save simics-ja/cc7b1f0c2d6c6585b0910f8aa06405a0 to your computer and use it in GitHub Desktop.
Save simics-ja/cc7b1f0c2d6c6585b0910f8aa06405a0 to your computer and use it in GitHub Desktop.
[my zsh config] macOS+zplug+PREZTO #zsh #shell #config
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Customize to your needs...
# zplug
export ZPLUG_HOME=$HOME/.zplug
source $ZPLUG_HOME/init.zsh
# zsh framework
zplug "sorin-ionescu/prezto"
# prezto modules
zplug "modules/environment", from:prezto
zplug "modules/terminal", from:prezto
zplug "modules/editor", from:prezto
zplug "modules/history", from:prezto
zplug "modules/directory", from:prezto
zplug "modules/git", from:prezto
zplug "modules/spectrum", from:prezto
zplug "modules/utility", from:prezto
zplug "modules/completion", from:prezto
zplug "modules/prompt", from:prezto
zplug "modules/homebrew", from:prezto
# completions
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
# zoxide (zoxide is pretty cd)
zplug "ajeetdsouza/zoxide"
# auto exa (exa is pretty ls: brew install exa)
j(){z $@ && exa --icons}
ji(){zi && exa --icons}
# zsh-gomi(file deletion utility) with fzf
zplug "junegunn/fzf-bin", \
as:command, \
from:gh-r, \
rename-to:"fzf", \
frozen:1
zplug "b4b4r07/zsh-gomi", \
as:command, \
use:bin/gomi, \
on:junegunn/fzf-bin
# interactive search
zplug "mollifier/anyframe"
zstyle ":anyframe:selector:" use fzf
# easily cd gitroot
zplug "mollifier/cd-gitroot"
if ! zplug check --verbose; then
printf 'Install? [y/N]: '
if read -q; then
echo; zplug install
fi
fi
zplug load --verbose
clear
# zsh history optimizer
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_NO_STORE
# anyframe keybind
bindkey '^p' anyframe-widget-put-history
bindkey '^r' anyframe-widget-execute-history
# PATH
export PATH=$PATH:$HOME/bin
export GOPATH=$HOME/go
# asdf
. $(brew --prefix asdf)/libexec/asdf.sh
# starship
eval "$(starship init zsh)"
# fzf
export FZF_DEFAULT_OPTS='--height 60% --reverse --border'
# grep
export GREP_COLOR='01:31'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment