dotfiles/config/zsh/.zshrc

72 lines
1.6 KiB
Bash
Raw Normal View History

# 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-07-01 20:53:40 +02:00
touch $HOME/.hushlogin
2023-04-28 02:11:31 +02:00
mkdir -p $XDG_CACHE_HOME/zsh
2023-07-19 15:11:07 +02:00
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
2024-09-20 00:56:52 +02:00
ln -sf $XDG_DATA_HOME/zsh/history $ZDOTDIR/.zsh_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
source $ZDOTDIR/aliases.zsh
2023-04-28 02:11:31 +02:00
source $ZDOTDIR/cleanhome.zsh
source $ZDOTDIR/keys.zsh
2024-07-06 19:12:37 +02:00
## it has to be last
source $ZDOTDIR/fzf.zsh
2021-09-06 12:37:22 +02:00
2023-04-28 02:11:31 +02:00
# source modules
2024-08-13 00:51:06 +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
2022-03-31 01:17:08 +02:00
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-30 00:57:55 +02:00
export LS_COLORS=$(vivid generate molokai)
2023-05-03 01:34:27 +02:00
else
unset LS_COLORS
fi
2024-06-24 15:20:23 +02:00
if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then
eval "$(oh-my-posh --config ${XDG_CONFIG_HOME}/omp/omp.toml init zsh)"
fi
2023-04-28 02:11:31 +02:00
# completion
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ''
autoload -Uz compinit
2023-05-03 01:34:27 +02:00
if [ ! -e $XDG_DATA_HOME/zsh/zcompdump.zwc ]; then
autoload -Uz zrecompile
zrecompile -p -R $XDG_DATA_HOME/zsh/zcompdump
fi
2024-08-13 12:20:43 +02:00
compinit -C -d $XDG_DATA_HOME/zsh/zcompdump
# quick note functionality
2023-05-03 01:34:27 +02:00
if [[ -f ~/.note ]]; then
2022-04-12 17:48:35 +02:00
echo
cat ~/.note
echo
fi
2024-06-25 00:06:22 +02:00
# cleaning
rm -rf ~/.warprc
# local settings
2024-08-13 00:51:06 +02:00
if [[ -f $HOME/.local/config/zsh ]]; then
source $HOME/.local/config/zsh
2023-05-03 01:34:27 +02:00
fi