Skip to content

Instantly share code, notes, and snippets.

@mattmc3 mattmc3/.zshrc
Created Oct 17, 2019

Embed
What would you like to do?
zsh: example of zgen + oh-my-zsh setup
# .zshrc
# setup zgen
export ZGEN_DIR="${ZDOTDIR:-$HOME}"/.zgen
[[ -d "$ZGEN_DIR" ]] || git clone https://github.com/tarjoilija/zgen.git --depth=1 "$ZGEN_DIR"
ZGEN_RESET_ON_CHANGE=(
${ZDOTDIR:-$HOME}/.zshrc
${ZDOTDIR:-$HOME}/zsh_plugins
)
# decide if you want to do compinit yourself
# ZGEN_AUTOLOAD_COMPINIT=false
ZSH="$ZGEN_DIR/robbyrussell/oh-my-zsh-master"
# to monitor plugin changes in files automatically use ZGEN_RESET_ON_CHANGE
# or run `zgen reset` manually
source "$ZGEN_DIR/zgen.zsh"
if ! zgen saved; then
# clone things we don't need to load directly
zgen clone robbyrussell/oh-my-zsh
# omz lib - pick the ones you want.
zgen load $ZSH/lib/clipboard.zsh
zgen load $ZSH/lib/functions.zsh
zgen load $ZSH/lib/history.zsh
zgen load $ZSH/lib/key-bindings.zsh
zgen load $ZSH/lib/termsupport.zsh
# omz plugins
zgen load $ZSH/plugins/colored-man-pages
zgen load $ZSH/plugins/history
# theme
zgen load sindresorhus/pure
# regular plugins
zgen load zsh-users/zsh-autosuggestions
zgen load zsh-users/zsh-completions
zgen load zsh-users/zsh-history-substring-search
# instead of all this, you could just use an external
# file to keep .zshrc clean
if [[ -f ${ZDOTDIR:-$HOME}/zsh_plugins ]]; then
zgen loadall < ${ZDOTDIR:-$HOME}/zsh_plugins
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.