Skip to content

Instantly share code, notes, and snippets.

@mattmc3 mattmc3/.zshrc
Created Oct 17, 2019

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 --depth=1 "$ZGEN_DIR"
# decide if you want to do compinit yourself
# 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
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.