mirror of
https://github.com/tomru/DotfilesOld.git
synced 2026-03-04 15:07:23 +01:00
use GNU stow for setup
This commit is contained in:
48
zsh/.zshrc
Normal file
48
zsh/.zshrc
Normal file
@@ -0,0 +1,48 @@
|
||||
# load custom executable functions
|
||||
for function in ~/.zsh/functions/*; do
|
||||
source $function
|
||||
done
|
||||
|
||||
# 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
|
||||
for config in "$_dir"/pre/**/*(N-.); do
|
||||
. $config
|
||||
done
|
||||
fi
|
||||
|
||||
for config in "$_dir"/**/*(N-.); do
|
||||
case "$config" in
|
||||
"$_dir"/pre/*)
|
||||
:
|
||||
;;
|
||||
"$_dir"/post/*)
|
||||
:
|
||||
;;
|
||||
*)
|
||||
if [ -f $config ]; then
|
||||
. $config
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -d "$_dir/post" ]; then
|
||||
for config in "$_dir"/post/**/*(N-.); do
|
||||
. $config
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
_load_settings "$HOME/.zsh/configs"
|
||||
|
||||
# Local config
|
||||
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
|
||||
|
||||
# aliases
|
||||
[[ -f ~/.aliases ]] && source ~/.aliases
|
||||
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
Reference in New Issue
Block a user