dotfiles/config/zsh/.zshrc

72 lines
1.7 KiB
Bash
Raw Normal View History

2024-10-15 00:44:53 +02:00
# shellcheck disable=SC1091,SC1094,SC2206,SC2148
# macOS specific
2024-06-19 23:32:59 +02:00
if [[ $(uname -s) = "Darwin" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
2023-10-20 14:34:48 +02:00
2023-04-28 02:11:31 +02:00
# prepare directories
2024-10-15 00:44:53 +02:00
touch "${HOME}/.hushlogin"
mkdir -p "${XDG_CACHE_HOME}/zsh"
mkdir -p "${XDG_DATA_HOME}/zsh"
2023-04-28 02:11:31 +02:00
2021-01-28 00:59:49 +01:00
# global exports and options
2021-05-11 14:24:48 +02:00
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_REDUCE_BLANKS
2021-05-11 15:17:44 +02:00
setopt SHARE_HISTORY
2022-07-23 17:29:49 +02:00
setopt INC_APPEND_HISTORY
2021-05-11 14:24:48 +02:00
2023-07-19 15:11:07 +02:00
# set path
2024-08-13 00:51:06 +02:00
path=(~/.local/bin "${path[@]}")
2023-04-28 02:11:31 +02:00
# source configuration
2024-10-15 00:44:53 +02:00
source "${ZDOTDIR}/aliases.zsh"
source "${ZDOTDIR}/keys.zsh"
2024-07-06 19:12:37 +02:00
## it has to be last
2024-10-15 00:44:53 +02:00
source "${ZDOTDIR}/fzf.zsh"
2021-09-06 12:37:22 +02:00
2023-04-28 02:11:31 +02:00
# source modules
2024-10-15 00:44:53 +02:00
source "${HOME}/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
source "${HOME}/.local/git/zsh_modules/wd/wd.plugin.zsh"
export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list"
2023-07-17 22:25:49 +02:00
2023-07-19 15:11:07 +02:00
# set fpath
2024-08-13 12:20:43 +02:00
fpath=(~/.local/git/zsh_modules/wd $fpath)
2022-03-30 11:58:54 +02:00
2023-04-28 02:11:31 +02:00
# theme and colors
2023-05-03 01:34:27 +02:00
if [[ $(command -v vivid) ]]; then
2024-09-01 14:28:10 +02:00
LS_COLORS=$(vivid generate ayu)
2024-10-15 00:44:53 +02:00
export LS_COLORS
2023-05-03 01:34:27 +02:00
else
unset LS_COLORS
fi
2024-11-02 23:23:27 +01:00
source "${ZDOTDIR}/p10k.zsh"
source ~/.local/git/zsh_modules/powerlevel10k/powerlevel10k.zsh-theme
if [[ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh"
2024-06-24 15:20:23 +02:00
fi
2023-04-28 02:11:31 +02:00
# completion
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ''
autoload -Uz compinit
2024-10-15 00:44:53 +02:00
if [ ! -e "${XDG_DATA_HOME}/zsh/zcompdump.zwc" ]; then
2023-05-03 01:34:27 +02:00
autoload -Uz zrecompile
2024-10-15 00:44:53 +02:00
zrecompile -p -R "${XDG_DATA_HOME}/zsh/zcompdump"
2023-05-03 01:34:27 +02:00
fi
2024-10-15 00:44:53 +02:00
compinit -C -d "${XDG_DATA_HOME}/zsh/zcompdump"
# quick note functionality
2024-10-15 00:44:53 +02:00
if [[ -f "${HOME}/.note" ]]; then
2022-04-12 17:48:35 +02:00
echo
2024-10-15 00:44:53 +02:00
cat "${HOME}/.note"
2022-04-12 17:48:35 +02:00
echo
fi
# local settings
2024-10-15 00:44:53 +02:00
if [[ -f "${HOME}/.local/config/zsh" ]]; then
source "${HOME}/.local/config/zsh"
2023-05-03 01:34:27 +02:00
fi