2023-02-16 12:27:43 +03:30
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
ZSH_PATH=$HOME/.zsh
|
|
|
|
|
|
|
|
#########################
|
|
|
|
######### PATH ##########
|
|
|
|
#########################
|
|
|
|
|
|
|
|
if [ -d "$HOME/.bin" ] ;
|
|
|
|
then PATH="$HOME/.bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$HOME/.local/bin" ] ;
|
|
|
|
then PATH="$HOME/.local/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$HOME/Applications" ] ;
|
|
|
|
then PATH="$HOME/Applications:$PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$HOME/.cargo/bin" ]
|
|
|
|
then PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Comment this line out to enable default emacs-like bindings
|
|
|
|
bindkey -v
|
|
|
|
|
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
# functions
|
|
|
|
[[ -f "$ZSH_PATH/functions.zsh" ]] && source $ZSH_PATH/functions.zsh
|
|
|
|
|
2013-03-01 23:32:03 -05:00
|
|
|
|
2014-07-22 16:51:20 +02:00
|
|
|
# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
|
|
|
|
# these are loaded first, second, and third, respectively.
|
|
|
|
_load_settings() {
|
|
|
|
_dir="$1"
|
|
|
|
if [ -d "$_dir" ]; then
|
|
|
|
if [ -d "$_dir/pre" ]; then
|
2018-10-24 07:42:23 +01:00
|
|
|
for config in "$_dir"/pre/**/*~*.zwc(N-.); do
|
2014-07-22 16:51:20 +02:00
|
|
|
. $config
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2014-10-03 10:28:08 -07:00
|
|
|
for config in "$_dir"/**/*(N-.); do
|
2014-07-22 16:51:20 +02:00
|
|
|
case "$config" in
|
2018-10-24 07:42:23 +01:00
|
|
|
"$_dir"/(pre|post)/*|*.zwc)
|
2014-07-22 16:51:20 +02:00
|
|
|
:
|
|
|
|
;;
|
|
|
|
*)
|
2018-10-24 07:42:23 +01:00
|
|
|
. $config
|
2014-07-22 16:51:20 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -d "$_dir/post" ]; then
|
2018-10-24 07:42:23 +01:00
|
|
|
for config in "$_dir"/post/**/*~*.zwc(N-.); do
|
2014-07-22 16:51:20 +02:00
|
|
|
. $config
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
2023-02-16 12:27:43 +03:30
|
|
|
_load_settings "$ZSH_PATH/configs"
|
2014-07-22 16:51:20 +02:00
|
|
|
|
2013-07-07 15:55:41 -07:00
|
|
|
# Local config
|
|
|
|
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
|
2017-01-15 13:08:42 +00:00
|
|
|
|
|
|
|
# aliases
|
2023-02-16 12:27:43 +03:30
|
|
|
[[ -f "$ZSH_PATH/aliases.zsh" ]] && source "$ZSH_PATH/aliases.zsh"
|