From c45c89cbe3de552b6e673c96b94dfec5e1fc5a79 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Thu, 17 Nov 2022 00:09:54 +0000
Subject: [PATCH] Move zsh manager from antigen to antidote
---
/dev/null | 1 -
.gitmodules | 6 +++---
zsh/zsh_plugins.txt | 5 +++++
zsh/DICT | 4 ++--
zsh/zshrc | 26 ++++++++++++++++----------
zsh/antidote | 1 +
6 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/.gitmodules b/.gitmodules
index 025450e..6aaf43e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "emacs/.emacs.d"]
path = emacs/emacs.d
url = https://github.com/Chizi123/.emacs.d.git
-[submodule "zsh/.zsh/antigen"]
- path = zsh/antigen
- url = https://github.com/zsh-users/antigen.git
+[submodule "zsh/antidote"]
+ path = zsh/antidote
+ url = https://github.com/mattmc3/antidote.git
diff --git a/zsh/DICT b/zsh/DICT
index 30f9b21..65ea53d 100644
--- a/zsh/DICT
+++ b/zsh/DICT
@@ -1,6 +1,6 @@
DEPS="all-shells"
-FILES="zshrc p10k.zsh antigen zprofile"
-LOCATIONS="${HOME}/.zshrc ${HOME}/.zsh/p10k.zsh ${HOME}/.zsh/antigen ${HOME}/.zprofile"
+FILES="zshrc p10k.zsh antidote zprofile zsh_plugins.txt"
+LOCATIONS="${HOME}/.zshrc ${HOME}/.zsh/p10k.zsh ${HOME}/.zsh/antidote ${HOME}/.zprofile ${HOME}/.zsh/zsh_plugins.txt"
custom() {
git submodule update --init
}
diff --git a/zsh/antidote b/zsh/antidote
new file mode 160000
index 0000000..602998b
--- /dev/null
+++ b/zsh/antidote
@@ -0,0 +1 @@
+Subproject commit 602998b05833ce13dc5e87e3b9aae8b0d93bb304
diff --git a/zsh/antigen b/zsh/antigen
deleted file mode 160000
index 64de2dc..0000000
--- a/zsh/antigen
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 64de2dcd95d6a8e879cd2244c763d99f0144e78e
diff --git a/zsh/zsh_plugins.txt b/zsh/zsh_plugins.txt
new file mode 100644
index 0000000..dc07d31
--- /dev/null
+++ b/zsh/zsh_plugins.txt
@@ -0,0 +1,5 @@
+zsh-users/zsh-syntax-highlighting
+zsh-users/zsh-autosuggestions
+zsh-users/zsh-completions
+
+romkatv/powerlevel10k
diff --git a/zsh/zshrc b/zsh/zshrc
index 1e07b24..73b02c0 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -27,6 +27,7 @@
setopt autocd extendedglob correct_all # Automatically cd without cd and expand globs
unsetopt beep notify # Turn off terminal beeps
bindkey -e #Emacs mode
+ZDOTDIR=${HOME}/.zsh
# common shell options
source ~/.commonshell
@@ -61,18 +62,23 @@
compinit
# Plugins with antigen
-if [ -f ~/.zsh/antigen/bin/antigen.zsh ]; then
+if [ -f ~/.zsh/antidote/antidote.zsh ]; then
ADOTDIR=~/.zsh
- _ANTIGEN_INSTALL_DIR=~/.zsh/antigen
- # ANTIGEN_LOG=~/log
- source ~/.zsh/antigen/bin/antigen.zsh
+ _ANTIGEN_INSTALL_DIR=~/.zsh/antidote
+ antidote_dir=${ZDOTDIR:-~}/antidote
+ plugins_txt=${ZDOTDIR:-~}/zsh_plugins.txt
+ static_file=${ZDOTDIR:-~}/zsh_plugins.zsh # ANTIGEN_LOG=~/log
- antigen bundle zsh-users/zsh-syntax-highlighting
- antigen bundle zsh-users/zsh-autosuggestions
- antigen bundle zsh-users/zsh-completions
- antigen theme romkatv/powerlevel10k
-
- antigen apply
+ if [[ ! $static_file -nt $plugins_txt ]]; then
+ (
+ source ~/.zsh/antidote/antidote.zsh
+ [[ -e $plugins_txt ]] || touch $plugins_txt
+ antidote bundle <$plugins_txt >$static_file
+ )
+ fi
+ autoload -Uz $antidote_dir/functions/antidote
+ source $static_file
+ unset antidote_dir plugins_txt static_file
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
--
Gitblit v1.10.0