2019-07-24 05:33:28 +00:00
|
|
|
#!/bin/zsh
|
2019-03-15 13:40:03 +00:00
|
|
|
# Clone zgen if you haven't already
|
|
|
|
check_zgen_installation() {
|
|
|
|
if [[ -z "$ZGEN_PARENT_DIR" ]]; then
|
2019-07-24 09:32:04 +00:00
|
|
|
ZGEN_PARENT_DIR=${XDG_CONFIG_HOME:="$HOME/.config/"}
|
2019-03-15 13:40:03 +00:00
|
|
|
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
|
2019-07-24 09:32:04 +00:00
|
|
|
cd "$ZGEN_PARENT_DIR" || return
|
|
|
|
git clone https://github.com/tarjoilija/zgen.git "$ZGEN_DIR"
|
2019-03-15 13:40:03 +00:00
|
|
|
fi
|
2019-07-24 05:33:28 +00:00
|
|
|
# shellcheck source=/home/marty/.config/zgen/zgen.zsh
|
|
|
|
# shellcheck disable=SC1091
|
2019-07-24 09:32:04 +00:00
|
|
|
source "$ZGEN_DIR"/zgen.zsh
|
2019-03-15 13:40:03 +00:00
|
|
|
unset ZGEN_PARENT_DIR
|
|
|
|
}
|
|
|
|
|
|
|
|
load_plugins() {
|
2019-07-24 09:32:04 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# Colorize the things if you have grc installed. Well, some of the
|
|
|
|
# things, anyway.
|
|
|
|
zgen load unixorn/warhol.plugin.zsh
|
|
|
|
|
|
|
|
zgen load chrissicool/zsh-256color
|
|
|
|
|
|
|
|
# Add Fish-like autosuggestions to your ZSH.
|
|
|
|
zgen load zsh-users/zsh-autosuggestions
|
|
|
|
|
|
|
|
# Bullet train prompt setup.
|
|
|
|
zgen load bhilburn/powerlevel9k powerlevel9k
|
|
|
|
|
|
|
|
# automatically sources (known/whitelisted) .autoenv.zsh files
|
|
|
|
# as long as you're in the folder (and can optionally 'unsource' on leaving)
|
|
|
|
zgen load Tarrasch/zsh-autoenv
|
|
|
|
|
|
|
|
# radically enhanced cd command, all sorts of options
|
|
|
|
zgen load b4b4r07/enhancd
|
|
|
|
|
|
|
|
# set up nvm, the npm version manager
|
|
|
|
zgen load lukechilds/zsh-nvm
|
|
|
|
|
|
|
|
# Add git helper scripts.
|
|
|
|
zgen load unixorn/git-extra-commands
|
|
|
|
|
|
|
|
# Tom Limoncelli's tooling for storing private information (keys, etc)
|
|
|
|
# in a repository securely by encrypting them with gnupg.
|
|
|
|
zgen load StackExchange/blackbox
|
|
|
|
|
|
|
|
# Load some oh-my-zsh plugins
|
|
|
|
zgen oh-my-zsh plugins/pip
|
|
|
|
zgen oh-my-zsh plugins/sudo
|
|
|
|
zgen oh-my-zsh plugins/aws
|
|
|
|
zgen oh-my-zsh plugins/chruby
|
|
|
|
zgen oh-my-zsh plugins/colored-man-pages
|
|
|
|
zgen oh-my-zsh plugins/git
|
|
|
|
zgen oh-my-zsh plugins/github
|
|
|
|
zgen oh-my-zsh plugins/python
|
|
|
|
zgen oh-my-zsh plugins/rsync
|
|
|
|
zgen oh-my-zsh plugins/screen
|
|
|
|
zgen oh-my-zsh plugins/vagrant
|
|
|
|
# check for autojump install before applying plugin
|
|
|
|
if type autojump >/dev/null 2>&1; then
|
|
|
|
zgen oh-my-zsh plugins/autojump
|
|
|
|
fi
|
|
|
|
zgen oh-my-zsh plugins/tmux
|
|
|
|
zgen oh-my-zsh plugins/tmuxinator
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# when in a directory with vagrant/docker files can use start, stop, up, down
|
|
|
|
zgen load Cloudstek/zsh-plugin-appup
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# Load more completion files for zsh from the zsh-lovers github repo.
|
|
|
|
zgen load zsh-users/zsh-completions src
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# Docker completion
|
|
|
|
zgen load srijanshetty/docker-zsh
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# Very cool plugin that generates zsh completion functions for commands
|
|
|
|
# if they have getopt-style help text. It doesn't generate them on the fly,
|
|
|
|
# you'll have to explicitly generate a completion, but it's still quite cool.
|
|
|
|
zgen load RobSis/zsh-completion-generator
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# Tab complete rakefile targets.
|
|
|
|
zgen load unixorn/rake-completion.zshplugin
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
# Load me last
|
|
|
|
GENCOMPL_FPATH=$HOME/.zsh/complete
|
2019-03-15 13:40:03 +00:00
|
|
|
|
2019-07-24 09:32:04 +00:00
|
|
|
zgen save
|
2019-03-15 13:40:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check_zgen_installation
|
|
|
|
if ! zgen saved; then
|
2019-07-24 09:32:04 +00:00
|
|
|
load_plugins
|
2019-03-15 13:40:03 +00:00
|
|
|
fi
|