refactor(zsh): move antigen from ~ to ~/.local/share

This commit is contained in:
winston 2022-08-20 02:54:40 +02:00
parent 3b40d61648
commit 8c17130bcc
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 18 additions and 16 deletions

View file

@ -1,6 +1,6 @@
# vim:ft=yaml:fenc=utf-8:fdm=marker # vim:ft=yaml:fenc=utf-8:fdm=marker
# zsh # zsh
.antigen/antigen.zsh: .local/share/antigen/antigen.zsh:
type: file type: file
url: "https://raw.githubusercontent.com/zsh-users/antigen/master/bin/antigen.zsh" url: "https://raw.githubusercontent.com/zsh-users/antigen/master/bin/antigen.zsh"
refreshPeriod: 168h refreshPeriod: 168h

View file

@ -1,11 +1,18 @@
# vim:ft=zsh:fenc=utf-8:fdm=marker # vim:ft=zsh:fenc=utf-8:fdm=marker
# load starship # load starship
eval "$(starship init zsh)" eval "$(starship init zsh)"
### plugins via antigen {{{ ### plugins via antigen {{{
# don't pollute $HOME with antigen
ADOTDIR="$HOME/.local/share/antigen"
if [[ ! -d "$ADOTDIR" ]]; then
mkdir -p "$ADOTDIR"
curl -L https://git.io/antigen > "$ADOTDIR/antigen.zsh"
chmod +x "$ADOTDIR"
fi
# load antigen # load antigen
source "$HOME/.antigen/antigen.zsh" source "$ADOTDIR/antigen.zsh"
antigen use oh-my-zsh antigen use oh-my-zsh
@ -25,11 +32,9 @@ antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-syntax-highlighting antigen bundle zsh-users/zsh-syntax-highlighting
antigen apply antigen apply
# }}} # }}}
### basics {{{ ### basics {{{
# history # history
export HISTFILE="$HOME/.zhistory" export HISTFILE="$HOME/.zhistory"
export HISTSIZE=10000 export HISTSIZE=10000
@ -44,11 +49,10 @@ setopt HIST_IGNORE_DUPS
function bitch() { function bitch() {
[ "$1" = "you" ] && [ "$2" = "better" ] && sudo "${@:3}" [ "$1" = "you" ] && [ "$2" = "better" ] && sudo "${@:3}"
} }
# }}} # }}}
### aliases & functions {{{ ### aliases & functions {{{
## basics, from common to peculiar tweaks {{{ ## basics {{{
# use exa+lsd to list directories, if available, falling back to ls aliases # use exa+lsd to list directories, if available, falling back to ls aliases
if [ -x "$(command -v lsd)" ] && [ -x "$(command -v exa)" ]; then if [ -x "$(command -v lsd)" ] && [ -x "$(command -v exa)" ]; then
# add a bit more space between the file icon & name # add a bit more space between the file icon & name
@ -86,7 +90,7 @@ alias switch_yubikeys='gpg-connect-agent "scd serialno" "learn --force" /bye'
# list tty devices on macOS, useful for Arduino & other boards # list tty devices on macOS, useful for Arduino & other boards
alias lstty='ls /dev | grep -E "^(tty\.|cu\.)" --color=never' alias lstty='ls /dev | grep -E "^(tty\.|cu\.)" --color=never'
#}}} ## }}}
## OS-dependent tweaks {{{ ## OS-dependent tweaks {{{
# manage yabai & ecosystem easier # manage yabai & ecosystem easier
@ -111,7 +115,7 @@ function twm() {
esac esac
} }
alias sbks='launchctl kickstart -k "gui/${UID}/homebrew.mxcl.sketchybar"' alias sbks='launchctl kickstart -k "gui/${UID}/homebrew.mxcl.sketchybar"'
alias onefetch='onefetch --true-color=never'
function icat() { function icat() {
if [ "$TERM_PROGRAM" = "WezTerm" ]; then if [ "$TERM_PROGRAM" = "WezTerm" ]; then
wezterm imgcat "$@" wezterm imgcat "$@"
@ -121,7 +125,7 @@ function icat() {
echo 'No image viewer defined for this terminal' echo 'No image viewer defined for this terminal'
fi fi
} }
#}}} ## }}}
## development {{{ ## development {{{
# use the combination of colordiff & diff-so-fancy # use the combination of colordiff & diff-so-fancy
@ -135,7 +139,6 @@ if [ -x "$(command -v colordiff)" ] && [ -x "$(command -v diff-so-fancy)" ]; the
kubectl diff "$@" | diff-so-fancy kubectl diff "$@" | diff-so-fancy
} }
fi fi
# }}}
## chezmoi ## chezmoi
alias cma='chezmoi add' alias cma='chezmoi add'
@ -147,8 +150,7 @@ alias cmm='chezmoi merge'
alias cmrm='chezmoi remove' alias cmrm='chezmoi remove'
alias cmst='chezmoi status' alias cmst='chezmoi status'
alias cmup='chezmoi update' alias cmup='chezmoi update'
## }}}
alias onefetch='onefetch --true-color=never'
### }}} ### }}}
### languages & frameworks {{{ ### languages & frameworks {{{
@ -161,6 +163,9 @@ fi
if [ -x "$(command -v rbenv)" ]; then if [ -x "$(command -v rbenv)" ]; then
eval "$(rbenv init - zsh)" eval "$(rbenv init - zsh)"
fi fi
# node
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# }}} # }}}
### technical BS {{{ ### technical BS {{{
@ -168,8 +173,5 @@ fi
function set_win_title(){ function set_win_title(){
echo -ne "\033]0;$(basename "$PWD")\007" echo -ne "\033]0;$(basename "$PWD")\007"
} }
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
# }}} # }}}
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion