From af49c39ba3057597010c9d2a0966686bd2cef520 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sun, 15 Nov 2020 01:16:00 +0100 Subject: [PATCH] zsh: Reorder zshrc components and move stuff Put the external plugins to the end as well as z-sy-h to the end of the plugins. Put the last remaining lines in the zshrc in their own modules. --- .config/zsh/.zshrc | 19 ------------------- .config/zsh/zshrc.d/50-autoload.zsh | 12 ++++++++++++ .../10-powerlevel10k | 0 .../15-powerlevel10k.theme | 0 .../20-autosuggestions | 0 .../40-fzf-tab | 0 .../50-fzf-key-bindings | 0 .../60-stderred | 0 .../65-stderred.theme | 0 .../zsh/zshrc.d/90-external-plugins/70-direnv | 1 + .../90-syntax-highlighting} | 0 .../95-syntax-highlighting.theme} | 0 12 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 .config/zsh/zshrc.d/50-autoload.zsh rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/10-powerlevel10k (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/15-powerlevel10k.theme (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/20-autosuggestions (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/40-fzf-tab (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/50-fzf-key-bindings (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/60-stderred (100%) rename .config/zsh/zshrc.d/{50-external-plugins => 90-external-plugins}/65-stderred.theme (100%) create mode 100644 .config/zsh/zshrc.d/90-external-plugins/70-direnv rename .config/zsh/zshrc.d/{50-external-plugins/30-syntax-highlighting => 90-external-plugins/90-syntax-highlighting} (100%) rename .config/zsh/zshrc.d/{50-external-plugins/35-syntax-highlighting.theme => 90-external-plugins/95-syntax-highlighting.theme} (100%) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index a0f165a..556576f 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -8,8 +8,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 -ZSH_CONF="$ZDOTDIR/plugins" - # https://github.com/romkatv/dotfiles-public/blob/7e49fc4fb71d/.zshrc#L35 comp-conf() { emulate -L zsh @@ -41,20 +39,3 @@ folder-source() { } folder-source "$ZDOTDIR"/zshrc.d - -autoload -U select-word-style && select-word-style bash - -## Load external config files and modules -autoload edit-command-line; zle -N edit-command-line -(( ! $+aliases[run-help] )) || unalias run-help -autoload -Uz run-help run-help-git zmv -if [[ -d "$ZDOTDIR/autoload" ]]; then - fpath=("$ZDOTDIR/autoload" $fpath) - autoload -Uz -- "" "${fpath[1]}"/[^_.]*(.xN:t) -fi -! command -v direnv &>/dev/null || eval "$(direnv hook zsh)" -# Reenable fzf-tab since `bindkey -v` seems to deactivate it -enable-fzf-tab - -## Setup zle -zle_highlight=('paste:none') diff --git a/.config/zsh/zshrc.d/50-autoload.zsh b/.config/zsh/zshrc.d/50-autoload.zsh new file mode 100644 index 0000000..7644011 --- /dev/null +++ b/.config/zsh/zshrc.d/50-autoload.zsh @@ -0,0 +1,12 @@ +autoload -U select-word-style && select-word-style bash + +autoload edit-command-line; zle -N edit-command-line + +(( ! $+aliases[run-help] )) || unalias run-help +autoload -Uz run-help run-help-git zmv + +# Load autoloadable functions +if [[ -d "$ZDOTDIR/autoload" ]]; then + fpath=("$ZDOTDIR/autoload" $fpath) + autoload -Uz -- "" "${fpath[1]}"/[^_.]*(.xN:t) +fi diff --git a/.config/zsh/zshrc.d/50-external-plugins/10-powerlevel10k b/.config/zsh/zshrc.d/90-external-plugins/10-powerlevel10k similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/10-powerlevel10k rename to .config/zsh/zshrc.d/90-external-plugins/10-powerlevel10k diff --git a/.config/zsh/zshrc.d/50-external-plugins/15-powerlevel10k.theme b/.config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/15-powerlevel10k.theme rename to .config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme diff --git a/.config/zsh/zshrc.d/50-external-plugins/20-autosuggestions b/.config/zsh/zshrc.d/90-external-plugins/20-autosuggestions similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/20-autosuggestions rename to .config/zsh/zshrc.d/90-external-plugins/20-autosuggestions diff --git a/.config/zsh/zshrc.d/50-external-plugins/40-fzf-tab b/.config/zsh/zshrc.d/90-external-plugins/40-fzf-tab similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/40-fzf-tab rename to .config/zsh/zshrc.d/90-external-plugins/40-fzf-tab diff --git a/.config/zsh/zshrc.d/50-external-plugins/50-fzf-key-bindings b/.config/zsh/zshrc.d/90-external-plugins/50-fzf-key-bindings similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/50-fzf-key-bindings rename to .config/zsh/zshrc.d/90-external-plugins/50-fzf-key-bindings diff --git a/.config/zsh/zshrc.d/50-external-plugins/60-stderred b/.config/zsh/zshrc.d/90-external-plugins/60-stderred similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/60-stderred rename to .config/zsh/zshrc.d/90-external-plugins/60-stderred diff --git a/.config/zsh/zshrc.d/50-external-plugins/65-stderred.theme b/.config/zsh/zshrc.d/90-external-plugins/65-stderred.theme similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/65-stderred.theme rename to .config/zsh/zshrc.d/90-external-plugins/65-stderred.theme diff --git a/.config/zsh/zshrc.d/90-external-plugins/70-direnv b/.config/zsh/zshrc.d/90-external-plugins/70-direnv new file mode 100644 index 0000000..d751f7a --- /dev/null +++ b/.config/zsh/zshrc.d/90-external-plugins/70-direnv @@ -0,0 +1 @@ +! command -v direnv &>/dev/null || eval "$(direnv hook zsh)" diff --git a/.config/zsh/zshrc.d/50-external-plugins/30-syntax-highlighting b/.config/zsh/zshrc.d/90-external-plugins/90-syntax-highlighting similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/30-syntax-highlighting rename to .config/zsh/zshrc.d/90-external-plugins/90-syntax-highlighting diff --git a/.config/zsh/zshrc.d/50-external-plugins/35-syntax-highlighting.theme b/.config/zsh/zshrc.d/90-external-plugins/95-syntax-highlighting.theme similarity index 100% rename from .config/zsh/zshrc.d/50-external-plugins/35-syntax-highlighting.theme rename to .config/zsh/zshrc.d/90-external-plugins/95-syntax-highlighting.theme