71 lines
2.1 KiB
Bash
71 lines
2.1 KiB
Bash
#!/bin/zsh
|
|
# Clone zgen if you haven't already
|
|
check_zgen_installation() {
|
|
if [[ -z "$ZGEN_PARENT_DIR" ]]; then
|
|
ZGEN_PARENT_DIR=${XDG_DATA_HOME:="$HOME/.local/share"}
|
|
ZGEN_DIR="$ZGEN_PARENT_DIR/zgen"
|
|
fi
|
|
if [[ ! -f $ZGEN_DIR/zgen.zsh ]]; then
|
|
if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then
|
|
mkdir -p "$ZGEN_PARENT_DIR"
|
|
fi
|
|
cd "$ZGEN_PARENT_DIR" || return
|
|
git clone https://github.com/tarjoilija/zgen.git "$ZGEN_DIR"
|
|
fi
|
|
# shellcheck source=/home/marty/.config/zgen/zgen.zsh
|
|
# shellcheck disable=SC1091
|
|
source "$ZGEN_DIR"/zgen.zsh
|
|
unset ZGEN_PARENT_DIR
|
|
}
|
|
|
|
load_plugins() {
|
|
ZGEN_LOADED=()
|
|
ZGEN_COMPLETIONS=()
|
|
|
|
zgen oh-my-zsh
|
|
|
|
# If you want to customize your plugin list, create a file named
|
|
# .zgen-local-plugins in your home directory. That file will be sourced
|
|
# during startup *instead* of running this load-starter-plugin-list function,
|
|
# so make sure to include everything from this function that you want to keep.
|
|
|
|
# If zsh-syntax-highlighting is bundled after zsh-history-substring-search,
|
|
# they break, so get the order right.
|
|
zgen load zdharma/fast-syntax-highlighting
|
|
# zgen load zsh-users/zsh-history-substring-search
|
|
|
|
# # Set keystrokes for substring searching
|
|
# zmodload zsh/terminfo
|
|
# bindkey "${terminfo[kcuu1]:?}" history-substring-search-up
|
|
# bindkey "${terminfo[kcud1]:?}" history-substring-search-down
|
|
|
|
# Automatically run zgen update and zgen selfupdate every 7 days.
|
|
zgen load unixorn/autoupdate-zgen
|
|
|
|
# Warn you when you run a command that you've set an alias for without
|
|
# using the alias.
|
|
zgen load djui/alias-tips
|
|
|
|
# Add Fish-like autosuggestions to your ZSH.
|
|
zgen load zsh-users/zsh-autosuggestions
|
|
|
|
zgen load romkatv/powerlevel10k powerlevel10k
|
|
# radically enhanced cd command, all sorts of options
|
|
# zgen load b4b4r07/enhancd
|
|
|
|
# set up nvm, the npm version manager
|
|
zgen load lukechilds/zsh-nvm
|
|
|
|
zgen oh-my-zsh plugins/colored-man-pages
|
|
|
|
# Load me last
|
|
GENCOMPL_FPATH=${XDG_CONFIG_HOME:-"$HOME/.config/zsh"}/complete
|
|
|
|
zgen save
|
|
}
|
|
|
|
check_zgen_installation
|
|
if ! zgen saved; then
|
|
load_plugins
|
|
fi
|