From: sev Date: Fri, 18 Oct 2024 04:53:28 +0000 (-0500) Subject: zsh: add basic plugin system, add evil-registers X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/d3e867c038fcb05cce5a72fd5134ff7b531c4f31?ds=inline zsh: add basic plugin system, add evil-registers --- diff --git a/.gitmodules b/.gitmodules index 8951e4c..e0303ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "editorconfig-vim"] path = etc/vim/pack/editorconfig-vim/start/editorconfig-vim url = https://github.com/editorconfig/editorconfig-vim.git +[submodule "etc/zsh/plugins/evil-registers"] + path = etc/zsh/plugins/zshrc/evil-registers + url = https://github.com/zsh-vi-more/evil-registers diff --git a/etc/zsh/.zlogin b/etc/zsh/.zlogin index e649935..f845825 100644 --- a/etc/zsh/.zlogin +++ b/etc/zsh/.zlogin @@ -1,5 +1,8 @@ # NOTE: all logic here moved to .zprofile, see comments there for rationale +### plugins +load-plugins zlogin + ### load site-specific load-site-dotfile zlogin diff --git a/etc/zsh/.zlogout b/etc/zsh/.zlogout index 8ab31d1..749c309 100644 --- a/etc/zsh/.zlogout +++ b/etc/zsh/.zlogout @@ -40,5 +40,8 @@ if [[ -o interactive ]] { echo logout } +### plugins +load-plugins zlogout + ### load site-specific load-site-dotfile zlogout diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index 170f4de..38b34c5 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -221,5 +221,8 @@ if [[ ! -v _sev_setup_ssh ]] { } unfunction _gpg_socketpath +### plugins +load-plugins zprofile + ### load site-specific load-site-dotfile zprofile diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index 7a923e9..37daf7f 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -316,6 +316,10 @@ if [[ -v commands[go] ]] { [[ ! -v GOBIN ]] && export GOBIN=~/.local/bin } +### plugins +autoload -Uz load-plugins +load-plugins zshenv + ### load zshenv site-specific autoload -Uz load-site-dotfile load-site-dotfile zshenv diff --git a/etc/zsh/.zshrc b/etc/zsh/.zshrc index c0fdef9..90e15a0 100644 --- a/etc/zsh/.zshrc +++ b/etc/zsh/.zshrc @@ -411,5 +411,8 @@ esac autoload -Uz promptinit && promptinit prompt arrows +### plugins +load-plugins zshrc + ### load site-specific load-site-dotfile zshrc diff --git a/etc/zsh/functions/Misc/load-plugins b/etc/zsh/functions/Misc/load-plugins new file mode 100644 index 0000000..8362049 --- /dev/null +++ b/etc/zsh/functions/Misc/load-plugins @@ -0,0 +1,9 @@ +emulate -L zsh + +[[ -n $1 ]] || exit 1 + +for p (${2:-${ZDOTDIR:-${_sev_home:-~/.zsh}}}/plugins/$1/*(N)) { + for f (${p:t}.{plugin.zsh,zsh,sh}) { + [[ -f $p$f ]] && source $p$f && break + } +} diff --git a/etc/zsh/plugins/zshrc/evil-registers b/etc/zsh/plugins/zshrc/evil-registers new file mode 160000 index 0000000..220d903 --- /dev/null +++ b/etc/zsh/plugins/zshrc/evil-registers @@ -0,0 +1 @@ +Subproject commit 220d903b5c3193a2da0ca97573bcc76be6a12d11