2023-07-21 15:35:28 -04:00
|
|
|
### This configuration makes zsh fully "XDG compliant". One change is needed to
|
|
|
|
### /etc/zsh/zshenv (or equivalent upstream profile):
|
|
|
|
### `export ZDOTDIR="$HOME"/.config/zsh`
|
|
|
|
#
|
|
|
|
# Lines configured by zsh-newuser-install
|
|
|
|
export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
2024-02-16 17:28:11 -05:00
|
|
|
mkdir -p "$(dirname "$HISTFILE")"
|
2023-08-05 16:17:28 -04:00
|
|
|
HISTSIZE=100000
|
|
|
|
SAVEHIST=100000
|
2023-07-21 15:35:28 -04:00
|
|
|
setopt autocd
|
|
|
|
unsetopt beep
|
|
|
|
bindkey -v
|
|
|
|
# End of lines configured by zsh-newuser-install
|
|
|
|
# The following lines were added by compinstall
|
2023-07-21 21:58:36 -04:00
|
|
|
zstyle :compinstall filename "$ZDOTDIR/.zshrc"
|
2023-07-21 15:35:28 -04:00
|
|
|
|
|
|
|
autoload -Uz compinit
|
|
|
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
|
|
|
# End of lines added by compinstall
|
|
|
|
### User configuration
|
2023-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
# for shell integration
|
|
|
|
precmd() {
|
2024-02-16 17:28:11 -05:00
|
|
|
print -Pn "\e]133;A\e\\"
|
2023-10-04 11:31:47 -04:00
|
|
|
}
|
|
|
|
|
2023-07-21 15:35:28 -04:00
|
|
|
# prompt configuration
|
|
|
|
autoload -Uz vcs_info
|
|
|
|
precmd_vcs_info () { vcs_info }
|
|
|
|
precmd_functions+=( precmd_vcs_info )
|
|
|
|
setopt prompt_subst
|
|
|
|
zstyle ':vcs_info:*' formats ' %F{green}%b'
|
|
|
|
PROMPT='%F{yellow}%n@%m %F{white}%1~%(?.. %?) $ '
|
|
|
|
RPROMPT='%f$vcs_info_msg_0_ '
|
|
|
|
|
2023-08-07 11:30:23 -04:00
|
|
|
alias adb='HOME="$XDG_DATA_HOME"/android adb'
|
2023-08-31 08:36:50 -04:00
|
|
|
alias boinctui='boinctui --boinchost=localhost'
|
2023-07-21 15:35:28 -04:00
|
|
|
alias bt='bluetoothctl'
|
|
|
|
alias c='clear'
|
|
|
|
alias daybreak='mosh daybreak -p 60101'
|
|
|
|
alias epoch='mosh epoch -p 60104'
|
2023-07-25 09:36:14 -04:00
|
|
|
alias grc='gridcoinresearchd'
|
2024-03-08 11:19:24 -05:00
|
|
|
alias l='eza -lh --all --octal-permissions'
|
2023-08-05 11:00:30 -04:00
|
|
|
alias less='less -r'
|
2023-10-04 11:31:47 -04:00
|
|
|
alias ls='eza'
|
|
|
|
alias lsa='eza -a'
|
|
|
|
alias lss='eza -a'
|
2023-08-17 14:05:49 -04:00
|
|
|
alias vim='nvim'
|
2023-08-18 15:58:58 -04:00
|
|
|
alias wake_circadian='ssh epoch wol a8:a1:59:11:06:f1'
|
2023-07-21 15:35:28 -04:00
|
|
|
alias xrm='sudo xbps-remove'
|
|
|
|
|
|
|
|
# GPG setup (and SSH)
|
2023-07-25 14:03:33 -04:00
|
|
|
if command -v keychain >/dev/null; then
|
2024-03-23 23:49:42 -04:00
|
|
|
alias keychain="keychain --nolock --absolute --dir $XDG_RUNTIME_DIR"
|
2024-03-23 23:55:26 -04:00
|
|
|
eval "$(keychain --quick --eval --agents gpg D7F966B85D985743C76A17AC5A9572AE7B2E7E1C)"
|
2023-07-25 09:54:20 -04:00
|
|
|
fi
|
2023-07-25 14:03:33 -04:00
|
|
|
if command -v gpgconf >/dev/null; then
|
2023-07-25 09:54:20 -04:00
|
|
|
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
|
|
|
export SSH_AUTH_SOCK
|
|
|
|
fi
|
2023-07-21 15:35:28 -04:00
|
|
|
### End user configuration
|
|
|
|
|
|
|
|
### hooks/includes
|
2024-04-19 15:34:32 -04:00
|
|
|
for plugin in zsh-syntax-highlighting zsh-history-substring-search \
|
|
|
|
zsh-autosuggestions; do
|
2024-02-16 17:28:11 -05:00
|
|
|
if [ -f /usr/share/zsh/plugins/$plugin/${plugin}.zsh ]; then
|
2024-04-19 15:34:32 -04:00
|
|
|
source /usr/share/zsh/plugins/$plugin/${plugin}.zsh
|
2024-02-16 17:28:11 -05:00
|
|
|
fi
|
|
|
|
done
|
2024-04-19 15:34:32 -04:00
|
|
|
bindkey '^[[A' history-substring-search-up
|
|
|
|
bindkey '^[[B' history-substring-search-down
|
|
|
|
bindkey -M vicmd 'k' history-substring-search-up
|
|
|
|
bindkey -M vicmd 'j' history-substring-search-down
|