aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-11-15 21:16:22 +0800
committerGuangxiong Lin <[email protected]>2023-11-15 21:50:31 +0800
commitd3090f37978866e38c63c6550771a4716094ac8e (patch)
treee49ac3afa01641f6216399aef2ba2897ad6222cf
parent6ff0ddbfe3245043fb888c64d3425d7168c1695b (diff)
downloaddotfiles-d3090f37978866e38c63c6550771a4716094ac8e.tar.gz
dotfiles-d3090f37978866e38c63c6550771a4716094ac8e.tar.bz2
dotfiles-d3090f37978866e38c63c6550771a4716094ac8e.zip
Migrate from zplug to zinit
-rw-r--r--.zinitrc23
-rwxr-xr-x.zplugrc23
-rw-r--r--.zshrc7
-rwxr-xr-xscripts/bootstrap.sh4
4 files changed, 30 insertions, 27 deletions
diff --git a/.zinitrc b/.zinitrc
new file mode 100644
index 0000000..b853289
--- /dev/null
+++ b/.zinitrc
@@ -0,0 +1,23 @@
+#!/usr/bin/env zsh
+
+ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
+[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
+[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
+source "${ZINIT_HOME}/zinit.zsh"
+
+autoload -Uz _zinit
+(( ${+_comps} )) && _comps[zinit]=_zinit
+
+zinit wait lucid atload'_zsh_autosuggest_start' light-mode for zsh-users/zsh-autosuggestions
+
+zinit wait lucid light-mode for \
+ zsh-users/zsh-syntax-highlighting \
+ zsh-users/zsh-completions
+
+PURE_PROMPT_SYMBOL='>'
+zinit \
+ compile'(pure|async).zsh' \
+ pick'async.zsh' \
+ src'pure.zsh' \
+ light-mode for \
+ sindresorhus/pure
diff --git a/.zplugrc b/.zplugrc
deleted file mode 100755
index 1c2ac00..0000000
--- a/.zplugrc
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env zsh
-
-export ZPLUG_HOME=$HOME/.zplug
-
-if [ ! -d $ZPLUG_HOME ]; then
- echo 'Installing zplug ... '
- git clone https://github.com/zplug/zplug.git $ZPLUG_HOME
-fi
-source $ZPLUG_HOME/init.zsh
-
-zplug "zsh-users/zsh-completions"
-# zsh-syntax-highlighting must be loaded after other plugins
-zplug "zsh-users/zsh-syntax-highlighting", defer:2
-zplug "dracula/zsh", as:theme
-
-if ! zplug check --verbose; then
- printf "Install? [y/N]: "
- if read -q; then
- echo; zplug install
- fi
-fi
-
-zplug load
diff --git a/.zshrc b/.zshrc
index 382b24c..49de68e 100644
--- a/.zshrc
+++ b/.zshrc
@@ -13,12 +13,16 @@ HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
+[[ $(uname) == Darwin ]] &&
+ source "$HOME/.macos"
+
source $HOME/.path
source $HOME/.env
source $HOME/.aliases
source $HOME/.functions
-[ -r $HOME/.zplugrc ] && source $HOME/.zplugrc
+source "$HOME/.zinitrc"
+
[ -r $HOME/.nnnrc ] && source $HOME/.nnnrc
[ -r $HOME/.fzfrc ] && source $HOME/.fzfrc
@@ -32,5 +36,4 @@ if command -v navi &> /dev/null; then
eval "$(navi widget zsh)"
fi
-[[ $(uname) == Darwin ]] && [ -r $HOME/.macos ] && source $HOME/.macos
[ -r $HOME/.zsh_local ] && source $HOME/.zsh_local
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index ada87ad..6ab0649 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -22,10 +22,10 @@ link_all () {
.tmux.conf .urlview .zshrc \
.vimrc .vim .path .functions .emacs.d .gitconfig \
.config/i3 .config/polybar .xinitrc .pam_environment \
- .zprofile .newsboat .ledgerrc .nnnrc .alacritty.yml .fzfrc .zplugrc \
+ .zprofile .newsboat .ledgerrc .nnnrc .alacritty.yml .fzfrc \
.env .config/kitty .wezterm.lua .config/mpv \
.config/sway .config/swaylock .config/zathura .tigrc .config/foot \
- .config/fish .arch.aliases .bashrc
+ .config/fish .arch.aliases .bashrc .zinitrc
}
main () {