2026-07-27 10:55:58 +02:00
|
|
|
# Powerlevel10k instant prompt and machine-local layers must remain first.
|
2017-04-12 10:07:44 +02:00
|
|
|
[[ -f ~/.zsh/.powerline_config ]] && source ~/.zsh/.powerline_config
|
|
|
|
|
[[ -f ~/.zsh/.user_config ]] && source ~/.zsh/.user_config
|
|
|
|
|
[[ -f ~/.zsh/.virtual_env_config.zsh ]] && source ~/.zsh/.virtual_env_config.zsh
|
2021-01-11 10:35:01 +01:00
|
|
|
[[ -f ~/.zsh/.local_config ]] && source ~/.zsh/.local_config
|
2018-07-29 16:26:51 +02:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
source "${ZDOTDIR:-$HOME}/.zsh/lib/updates.zsh"
|
2025-08-06 10:51:09 +02:00
|
|
|
export LC_OSC52=1
|
2024-08-07 12:42:04 +02:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
plugins_txt=${ZDOTDIR:-$HOME}/.zsh/.zsh_plugins.txt
|
|
|
|
|
static_file=${ZDOTDIR:-$HOME}/.cache/zsh/.zsh_plugins.zsh
|
|
|
|
|
source "${ZDOTDIR:-$HOME}/.zsh/lib/antidote.zsh"
|
|
|
|
|
source "${ZDOTDIR:-$HOME}/.zsh/lib/interactive.zsh"
|
2017-04-12 10:07:44 +02:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
bindkey '^w' kill-region
|
2023-07-21 09:14:10 +02:00
|
|
|
bindkey -v
|
|
|
|
|
VI_MODE_SET_CURSOR=true
|
2023-02-21 11:15:19 +01:00
|
|
|
|
2024-12-22 12:29:28 +01:00
|
|
|
[[ -f ~/.zsh/.mac_config.zsh ]] && source ~/.zsh/.mac_config.zsh
|
2026-07-27 10:39:34 +02:00
|
|
|
if (( $+commands[go] )); then
|
|
|
|
|
export GOPATH="$(go env GOPATH 2>/dev/null)"
|
|
|
|
|
[[ -n "$GOPATH" ]] && path+=("$GOPATH/bin")
|
2023-02-09 16:29:49 +01:00
|
|
|
fi
|
2021-11-09 08:36:16 +01:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
# Use safe wrappers after ~/.local/bin has been added to PATH.
|
2026-07-10 11:53:07 +02:00
|
|
|
(( $+commands[safecp] )) && alias cp=safecp
|
|
|
|
|
(( $+commands[safemv] )) && alias mv=safemv
|
2026-07-22 10:45:19 +02:00
|
|
|
(( $+commands[safescp] )) && alias scp=safescp
|
2026-07-10 11:53:07 +02:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
if [[ -f ~/.ssh/sudo_key ]]; then
|
|
|
|
|
[[ -e /tmp/sudo-agent.sock ]] || ssh-agent -a /tmp/sudo-agent.sock &>/dev/null
|
|
|
|
|
SSH_AUTH_SOCK=/tmp/sudo-agent.sock ssh-add -l |
|
|
|
|
|
grep -q "$(ssh-keygen -lf ~/.ssh/sudo_key | awk '{print $2}')" ||
|
|
|
|
|
SSH_AUTH_SOCK=/tmp/sudo-agent.sock ssh-add ~/.ssh/sudo_key
|
2023-10-31 11:54:49 +01:00
|
|
|
fi
|
2023-07-25 13:59:37 +02:00
|
|
|
export SUDO_ASKPASS=$(command -v ssh-askpass)
|
|
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
if [[ -f ~/dotfiles/zsh/.p10k.mac.zsh ]]; then
|
|
|
|
|
p10k_config=~/dotfiles/zsh/.p10k.mac.zsh
|
|
|
|
|
else
|
|
|
|
|
p10k_config=~/dotfiles/zsh/.p10k.zsh
|
|
|
|
|
fi
|
|
|
|
|
source "${ZDOTDIR:-$HOME}/.zsh/lib/prompt.zsh"
|
2023-09-03 12:55:52 +02:00
|
|
|
|
|
|
|
|
alias screenshot_mode='powerlevel10k_plugin_unload; export PS1="$ "; python3 ~/.config/alacritty/screenshot_mode.py on'
|
|
|
|
|
alias screenshot_mode_off='prompt_powerlevel9k_setup; python3 ~/.config/alacritty/screenshot_mode.py off'
|
2026-07-27 10:55:58 +02:00
|
|
|
antidote update &>/dev/null &|
|
2024-10-14 15:44:52 +02:00
|
|
|
|
2026-07-27 10:39:34 +02:00
|
|
|
[[ -d "$HOME/.lmstudio/bin" ]] && path+=("$HOME/.lmstudio/bin")
|
|
|
|
|
[[ -d "$HOME/.runai/bin" ]] && path+=("$HOME/.runai/bin")
|
|
|
|
|
runai_bin="$HOME/.runai/bin/runai"
|
2026-07-27 10:37:12 +02:00
|
|
|
runai_completion=${ZDOTDIR:-$HOME}/.cache/zsh/runai-completion.zsh
|
|
|
|
|
if [[ -x "$runai_bin" ]]; then
|
|
|
|
|
if [[ ! -s "$runai_completion" || "$runai_bin" -nt "$runai_completion" ]]; then
|
|
|
|
|
runai_completion_tmp="$runai_completion.$$.tmp"
|
|
|
|
|
if "$runai_bin" --quiet completion zsh >| "$runai_completion_tmp"; then
|
|
|
|
|
command mv -f "$runai_completion_tmp" "$runai_completion"
|
|
|
|
|
else
|
|
|
|
|
command rm -f "$runai_completion_tmp"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
[[ -s "$runai_completion" ]] && source "$runai_completion"
|
|
|
|
|
fi
|
2026-07-16 14:25:28 +02:00
|
|
|
|
2026-07-27 10:55:58 +02:00
|
|
|
# Keep this last: activate must snapshot the fully built PATH for deactivate.
|
2026-07-27 10:39:34 +02:00
|
|
|
typeset -U path PATH
|
2026-07-27 10:55:58 +02:00
|
|
|
[[ -z "${VIRTUAL_ENV:-}" ]] && unset VIRTUAL_ENV
|
|
|
|
|
if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then
|
2026-07-16 14:25:28 +02:00
|
|
|
if [[ ":$PATH:" != *":$VIRTUAL_ENV/bin:"* ]]; then
|
|
|
|
|
source "$VIRTUAL_ENV/bin/activate"
|
|
|
|
|
fi
|
|
|
|
|
fi
|