2022-01-08 16:45:34 +00:00
|
|
|
stty -ixon # Disable ctrl-s and ctrl-q.
|
2024-03-12 17:15:11 +00:00
|
|
|
|
2019-01-11 18:13:34 +00:00
|
|
|
# load modules
|
2023-12-12 22:35:52 +00:00
|
|
|
source ~/.zsh/zsh-completions/zsh-completions.plugin.zsh
|
2024-03-27 14:29:16 +00:00
|
|
|
# source zvm immediately
|
|
|
|
ZVM_INIT_MODE=sourcing
|
2024-03-02 14:16:08 +00:00
|
|
|
# Disable the cursor style feature
|
|
|
|
ZVM_CURSOR_STYLE_ENABLED=false
|
2023-12-12 22:35:52 +00:00
|
|
|
[ -z "$NVIM" ] && source ~/.zsh/zsh-vi-mode/zsh-vi-mode.plugin.zsh
|
2021-12-07 16:53:57 +00:00
|
|
|
|
2023-12-12 22:35:52 +00:00
|
|
|
if command -v fzf >/dev/null; then
|
2024-03-27 14:29:16 +00:00
|
|
|
source ~/.bash/fzf/shell/completion.zsh
|
|
|
|
source ~/.bash/fzf/shell/key-bindings.zsh
|
|
|
|
source ~/.bash/fzf-tab-completion/zsh/fzf-zsh-completion.sh
|
2023-12-12 22:35:52 +00:00
|
|
|
fi
|
2021-12-07 16:53:57 +00:00
|
|
|
|
2024-03-27 13:27:43 +00:00
|
|
|
source ~/.zsh/envs.zsh
|
|
|
|
|
2024-03-27 05:18:01 +00:00
|
|
|
# osc-7 support for foot
|
2023-10-24 04:25:27 +00:00
|
|
|
function osc7-pwd() {
|
|
|
|
emulate -L zsh # also sets localoptions for us
|
|
|
|
setopt extendedglob
|
|
|
|
local LC_ALL=C
|
|
|
|
printf '\e]7;file://%s%s\e\' $HOST ${PWD//(#m)([^@-Za-z&-;_~])/%${(l:2::0:)$(([##16]#MATCH))}}
|
|
|
|
}
|
|
|
|
|
|
|
|
function chpwd-osc7-pwd() {
|
|
|
|
(( ZSH_SUBSHELL )) || osc7-pwd
|
|
|
|
}
|
2024-03-27 03:50:54 +00:00
|
|
|
chpwd_functions+=(chpwd-osc7-pwd)
|
2023-10-24 04:25:27 +00:00
|
|
|
|
2022-02-06 16:59:45 +00:00
|
|
|
# completion settings
|
2018-02-01 22:34:24 +00:00
|
|
|
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
|
|
|
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**'
|
|
|
|
zstyle ':completion:*' max-errors 2
|
|
|
|
zstyle ':completion:*' menu select=1
|
2019-06-26 21:59:48 +00:00
|
|
|
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename "${HOME}/.zshrc" zstyle ':completion:*' rehash true
|
2022-02-06 16:39:29 +00:00
|
|
|
zstyle ':completion::complete:*' use-cache 1
|
2018-02-01 22:34:24 +00:00
|
|
|
|
2024-03-27 05:18:01 +00:00
|
|
|
autoload -U compinit && compinit
|
|
|
|
autoload -U +X bashcompinit && bashcompinit && complete -o bashdefault -o default -o nospace -C qpdf qpdf
|
|
|
|
|
2022-02-06 16:59:45 +00:00
|
|
|
# history file settings
|
2019-08-25 09:49:08 +00:00
|
|
|
export HISTFILE=~/.histfile
|
2022-01-17 17:11:09 +00:00
|
|
|
export HISTSIZE=100000
|
|
|
|
export SAVEHIST=100000
|
2022-09-23 14:49:32 +00:00
|
|
|
setopt appendhistory notify histexpiredupsfirst histsavenodups \
|
|
|
|
incappendhistorytime histnostore histignorespace share_history
|
2022-02-06 16:59:45 +00:00
|
|
|
|
2018-02-01 22:34:24 +00:00
|
|
|
unsetopt beep
|
|
|
|
|
2024-03-27 05:18:01 +00:00
|
|
|
# vcs prompt info
|
2024-03-27 04:51:16 +00:00
|
|
|
autoload -Uz vcs_info
|
|
|
|
vcs_info_format() {
|
|
|
|
[ -n "${vcs_info_msg_0_}" ] && vcs_info_formatted=" ${vcs_info_msg_0_}" || vcs_info_formatted=""
|
|
|
|
}
|
|
|
|
|
|
|
|
zstyle ':vcs_info:*' check-for-staged-changes true
|
2024-03-27 04:55:30 +00:00
|
|
|
zstyle ':vcs_info:*' check-for-changes true
|
2024-03-27 04:51:16 +00:00
|
|
|
|
|
|
|
# Set custom strings for an unstaged vcs repo changes (*) and staged changes (+)
|
|
|
|
zstyle ':vcs_info:*' unstagedstr ' *'
|
|
|
|
zstyle ':vcs_info:*' stagedstr ' +'
|
|
|
|
# Set the format of the Git information for vcs_info
|
|
|
|
zstyle ':vcs_info:git:*' formats '(%b%u%c)'
|
|
|
|
zstyle ':vcs_info:git:*' actionformats '(%b|%a%u%c)'
|
2022-10-07 14:20:18 +00:00
|
|
|
|
2024-03-27 05:18:01 +00:00
|
|
|
precmd_functions+=(vcs_info vcs_info_format)
|
|
|
|
|
|
|
|
# prompt
|
|
|
|
[ "$GRAPHICAL_TTY" = 1 ] && shell_char=❯ || shell_char=$
|
|
|
|
[ -n "$SSH_CONNECTION" ] && prompt_host='%B%F{red}%n@%m%f '
|
|
|
|
|
|
|
|
setopt prompt_subst
|
|
|
|
PROMPT='${prompt_host}%F{blue}%4~%f%b%F{green}${vcs_info_formatted}%f %(?.%F{green}.%F{red})${shell_char}%f '
|
|
|
|
|
|
|
|
# set format for the time command
|
|
|
|
TIMEFMT="%J %mU user %mS system %P cpu %*E total"
|
|
|
|
|
|
|
|
# set tty for gpg-agent
|
|
|
|
export GPG_TTY="$(tty)"
|
2024-03-27 14:10:49 +00:00
|
|
|
export PINENTRY_USER_DATA="USE_CURSES=1"
|
2024-03-27 05:18:01 +00:00
|
|
|
odr-update-gpg-agent() {
|
|
|
|
gpg-connect-agent updatestartuptty /bye &>/dev/null
|
|
|
|
}
|
|
|
|
preexec_functions+=(odr-update-gpg-agent)
|
|
|
|
|
|
|
|
# local config
|
|
|
|
. ~/.shaliases
|
|
|
|
[ -f ~/.zshrc.local ] && . ~/.zshrc.local
|