Skip to content

Commit e935042

Browse files
committed
zsh: replace zinit with my own 'plugin manager'
1 parent 751b5d2 commit e935042

File tree

5 files changed

+85
-18
lines changed

5 files changed

+85
-18
lines changed

.config/zsh/.zshrc

+15-8
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ source "$ZDOTDIR/keybinds.zsh"
1515
# Load "history-fzf" function.
1616
source "$ZDOTDIR/history-fzf.zsh"
1717

18-
# Install zinit plugin manager.
19-
source "$ZDOTDIR/zinit.zsh"
18+
# Install my crappy "plugin manager".
19+
source "$ZDOTDIR/zeal.zsh"
2020

2121
# Completion tweaks.
2222
zstyle ':completion:*' menu select
@@ -26,14 +26,21 @@ zstyle ':completion:*:default' list-colors "$(dircolors)"
2626
# Autoload functions.
2727
autoload -Uz compinit && compinit
2828
autoload -Uz colors && colors
29+
# autoload -Uz promptinit && promptinit
30+
31+
zeal install "sindresorhus/pure"
32+
fpath+=($ZEAL_PLUGIN_DIR/pure)
2933
autoload -Uz promptinit && promptinit
34+
prompt pure
35+
36+
zeal install "zsh-users/zsh-syntax-highlighting"
37+
source "$ZEAL_PLUGIN_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
38+
ZSH_HIGHLIGHT_STYLES[comment]="fg=8,bold"
39+
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets)
40+
41+
zeal install "zsh-users/zsh-autosuggestions"
42+
source "$ZEAL_PLUGIN_DIR/zsh-autosuggestions/zsh-autosuggestions.zsh"
3043

31-
# Define plugins to be installed by zinit.
32-
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
33-
zinit light sindresorhus/pure
34-
zinit light zdharma-continuum/fast-syntax-highlighting
35-
zinit light zsh-users/zsh-autosuggestions
36-
zinit light zsh-users/zsh-completions
3744

3845
# Launch tmux if not already running within tmux, do not spawn tmux
3946
# when remotely accessing via ssh.

.config/zsh/alias.zsh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# vi: ft=zsh
2+
3+
alias vim="nvim"
4+
alias vimdiff="nvim -d -c 'tabdo windo set nolist'"
5+
alias diff="diff --color=auto"
6+
alias grep="grep --color=auto"
7+
alias dmesg="dmesg --color=always"
8+
alias history="history -i"
9+
alias tb="nc termbin 9999"
10+
alias ls="eza -g --group-directories-first"
11+
alias tree="eza --tree"
12+
alias ip="ip -color=auto"
13+
14+
alias weechat='firejail --private="$XDG_DATA_HOME/firejail/weechat" -- weechat'
15+

.config/zsh/env.zsh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# vi: ft=zsh
2+
3+
export HISTPATH="$XDG_STATE_HOME/zsh"
4+
export HISTFILE="$HISTPATH/.zsh_history"
5+
export HISTSIZE=1000000
6+
export SAVEHIST=1000000
7+
8+
if [[ ! -d "$HISTPATH" ]]; then
9+
mkdir -p "$HISTPATH"
10+
fi
11+
12+
export LESSHISTFILE="-"
13+
export MANROFFOPT="-c"
14+
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
15+
16+
export GOPATH="$XDG_DATA_HOME/go"
17+
export CARGO_HOME="$XDG_DATA_HOME/cargo"
18+
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
19+
20+
export GPG_TTY="$(tty)"
21+

.config/zsh/zeal.zsh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# vi: ft=zsh
2+
3+
export ZEAL_DIR="$XDG_DATA_HOME/zeal"
4+
export ZEAL_PLUGIN_DIR="$ZEAL_DIR/plugins"
5+
export -a ZEAL_INSTALLED_PLUGINS=()
6+
7+
__zeal_plugin_install() {
8+
local plugin_name="${1:t}"
9+
local plugin_path="$ZEAL_PLUGIN_DIR/$plugin_name"
10+
11+
if [[ ! -d "$plugin_path" ]]; then
12+
echo "-- Plugin Install Started: $1 --"
13+
git clone "https://github.com/${1}.git" "$plugin_path"
14+
echo "-- Plugin Install Completed: $1 --\n"
15+
fi
16+
17+
ZEAL_INSTALLED_PLUGINS+=("$1")
18+
}
19+
20+
__zeal_plugin_update() {
21+
for p in "${ZEAL_INSTALLED_PLUGINS[@]}"; do
22+
echo "-- Plugin Update Started: $p --"
23+
git -C "$ZEAL_PLUGIN_DIR/${p:t}" pull
24+
echo "-- Plugin Update Completed: $p --\n"
25+
done
26+
}
27+
28+
zeal() {
29+
case "$1" in
30+
"install") __zeal_plugin_install "${@:2}";;
31+
"update") __zeal_plugin_update "${@:2}";;
32+
"clean") __zeal_plugin_clean "${@:2}";;
33+
esac
34+
}

.config/zsh/zinit.zsh

-10
This file was deleted.

0 commit comments

Comments
 (0)