From 40b6d2220ce80f6f468f673cd8cb1f7cf8f852a8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Feb 2020 16:28:36 +0100 Subject: [PATCH] Remove zsh plugin manager Plugins are managed directly through pacman packages now. Since I am only using six zsh plugins and they are staying relatively constant and not changing much, pacman seems a much more sane way to manage them without cluttering up my zsh initialization routine. All zgen management can go and just needs 6 `source` lines in order to load the plugin entrypoints. --- _bootstrap/packages.txt | 14 ++++++-- zsh/.config/zsh/.zshrc | 13 +++++-- zsh/.config/zsh/plugins.zsh | 72 ------------------------------------- 3 files changed, 22 insertions(+), 77 deletions(-) delete mode 100644 zsh/.config/zsh/plugins.zsh diff --git a/_bootstrap/packages.txt b/_bootstrap/packages.txt index 90ce62c..611c198 100644 --- a/_bootstrap/packages.txt +++ b/_bootstrap/packages.txt @@ -10,7 +10,6 @@ dialog docker dunst exa -fakeroot fasd feh flashfocus-git @@ -70,9 +69,10 @@ psmisc pulseaudio-alsa pulsemixer python-pdfminer.six -python-pip +python-pipx python-pybtex python-pynvim +python-ueberzug qutebrowser redshift ripgrep-all @@ -123,3 +123,13 @@ yarn yay youtube-dl zathura-pdf-mupdf +pacman-contrib + +# zsh plugins +oh-my-zsh-git +alias-tips-git +zsh-autosuggestions +zsh-completions-git +zsh-fast-syntax-highlighting-git +zsh-theme-powerlevel10k-git +nvm diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 227a804..127d395 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -11,9 +11,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -# load all plugins -[ -f "$ZSHCONFDIR/plugins.zsh" ] && source "$ZSHCONFDIR/plugins.zsh" - # Set completion style # The following lines were added by compinstall zstyle ':completion:*' completer _complete _ignored _approximate @@ -23,6 +20,16 @@ zstyle ':completion:*' menu select=1 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename "$ZSHCONFDIR/.zshrc" # End of lines added by compinstall + +# load plugins +source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme +source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +source /usr/share/zsh/plugins/alias-tips/alias-tips.plugin.zsh +source /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh +source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh +source /usr/share/nvm/init-nvm.sh + autoload -Uz compinit zmv compinit diff --git a/zsh/.config/zsh/plugins.zsh b/zsh/.config/zsh/plugins.zsh deleted file mode 100644 index ff21c78..0000000 --- a/zsh/.config/zsh/plugins.zsh +++ /dev/null @@ -1,72 +0,0 @@ -#!/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 - - zgen load zsh-users/zsh-completions - - # Load me last - GENCOMPL_FPATH=${XDG_CONFIG_HOME:-"$HOME/.config/zsh"}/complete - - zgen save -} - -check_zgen_installation -if ! zgen saved; then - load_plugins -fi