Refactor: PZ => Antidote (#3)

* Rewrite .zshrc for Antidote

* Add .zsh_plugins.txt

* Fix .zshrc

* Remove pure prompt

* Remove pz_upgrade()

* Update Zsh readme

* Move shell sugar plugins to the bottom

* Change $zhome to $ZDOTDIR
This commit is contained in:
the_4n0nym0u53 2022-03-10 22:45:31 +01:00 committed by GitHub
parent 42be07c2d6
commit 9d785d2077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 31 deletions

View file

@ -0,0 +1,14 @@
# OMZ plugins and libs
ohmyzsh/ohmyzsh path:lib/git.zsh
ohmyzsh/ohmyzsh path:lib/key-bindings.zsh
ohmyzsh/ohmyzsh path:plugins/fzf
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/z
# Prompts
romkatv/powerlevel10k kind:fpath
# Some shell sugar
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-syntax-highlighting

View file

@ -3,38 +3,30 @@
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# Some variables
PZ_PLUGIN_HOME="$ZDOTDIR/plugins"
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern regexp root line)
ZLE_RPROMPT_INDENT=0
# Load the .zsh files
for file in $ZDOTDIR/*.zsh; do
source $file
for zfile in $ZDOTDIR/*.zsh; do
source $zfile
done
# Initialize PZ
[[ -d $PZ_PLUGIN_HOME/pz ]] ||
git clone -b pz https://github.com/mattmc3/antidote.git $PZ_PLUGIN_HOME/pz
source $PZ_PLUGIN_HOME/pz/pz.zsh
# Clone Antidote if necessary and generate a static plugin file
if [[ $ZDOTDIR/.zsh_plugins.zsh -ot $ZDOTDIR/.zsh_plugins.txt ]]; then
[[ -e $ZDOTDIR/.antidote ]] || git clone --depth=1 https://github.com/mattmc3/antidote.git $ZDOTDIR/.antidote
[[ -e $ZDOTDIR/.zsh_plugins.txt ]] || touch $ZDOTDIR/.zsh_plugins.txt
(
source $ZDOTDIR/.antidote/antidote.zsh
antidote bundle <$ZDOTDIR/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh
)
fi
# Load Antidote and plugins
autoload -Uz $ZDOTDIR/.antidote/functions/antidote
source $ZDOTDIR/.zsh_plugins.zsh
# Set p10k prompt
pz prompt romkatv/powerlevel10k
# Source regular plugins
pz source zsh-users/zsh-autosuggestions
pz source zsh-users/zsh-completions
# Source OMZ libs
pz source ohmyzsh/ohmyzsh lib/git
pz source ohmyzsh/ohmyzsh lib/key-bindings
# Source OMZ plugins
pz source ohmyzsh/ohmyzsh plugins/fzf
pz source ohmyzsh/ohmyzsh plugins/git
pz source ohmyzsh/ohmyzsh plugins/z
# Always source syntax highlighting plugin last
pz source zsh-users/zsh-syntax-highlighting
autoload -Uz promptinit && promptinit && prompt powerlevel10k
# Load p10k configuration
[[ -f $ZDOTDIR/.p10k.zsh ]] && source $ZDOTDIR/.p10k.zsh

View file

@ -20,9 +20,3 @@ get_ip() {
eval "wget $ARGS -qO- 'https://ifconfig.co/json$IP'"
}
pz_upgrade() {
pz zcompile -c >/dev/null
pz pull
pz zcompile >/dev/null
}

View file

@ -1,5 +1,5 @@
# Zsh config
For plugins, this Zsh config uses [PZ](https://github.com/mattmc3/pz.git), a minimal and easy to use Zsh plugin manager.
For plugins, this Zsh config uses [Antidote](https://github.com/mattmc3/antidote.git), a minimal and easy to use Zsh plugin manager.
Instead of directly using Oh-My-Zsh, we load specific plugins from it. I like to keep it simple. Also, Oh-My-Zsh is slow, this is much faster.