dotwryn/zsh/rc

50 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-12-02 17:16:05 +00:00
#!/bin/zsh
2020-09-17 03:06:44 +00:00
2021-02-25 00:38:02 +00:00
source "$HOME/.config/wryn/env/env"
2019-12-02 17:16:05 +00:00
# --- load custom plugins ------------------------------------------
2021-02-25 00:38:02 +00:00
# zsh config : must load first for zsh-plugins to work
source "$DOTWRYN/zsh/config"
for file in $(find "$DOTWRYN/zsh" -maxdepth 1 -type f ! -name 'rc' ! -name 'config'); do source $file; done;
2019-12-02 17:16:05 +00:00
# operating system specific plugins
case "$OSTYPE" in
linux-gnu )
2021-02-25 00:38:02 +00:00
for file in $(find "$DOTWRYN/zsh/linux" -type f); do source $file; done;
;;
darwin* )
2021-02-25 00:38:02 +00:00
for file in $(find "$DOTWRYN/zsh/osx" -type f); do source $file; done;
;;
esac
2019-12-02 17:16:05 +00:00
# --- set default editor -------------------------------------------
SET_PREFERRED_EDITOR() {
2020-11-10 23:14:06 +00:00
# load preference from environment (vi vim) by default
[[ -z $PREFERRED_EDITOR ]] && { echo 'unable to find $PREFERRED_EDITOR environment variable'; return 1; }
2019-12-02 17:16:05 +00:00
2020-11-10 23:14:06 +00:00
[[ $EDITOR == "${PREFERRED_EDITOR[-1]}" ]] && [[ $VISUAL == "${PREFERENCE[-1]}" ]] && return 0;
local AVAILABLE_EDITOR="$EDITOR";
2020-11-10 23:14:06 +00:00
for program in $PREFERRED_EDITOR; do which $program >/dev/null 2>&1 && AVAILABLE_EDITOR="$program"; done
2019-12-02 17:16:05 +00:00
export EDITOR="$AVAILABLE_EDITOR";
export VISUAL="$AVAILABLE_EDITOR";
2020-11-04 19:57:36 +00:00
}
SET_PREFERRED_EDITOR
2019-12-02 17:16:05 +00:00
# --- load external plugins ----------------------------------------
for PLUGIN in $EXTERNAL_PLUGIN_LIST; do
[ -f "$PLUGIN" ] && source "$PLUGIN"
done
2020-11-04 19:57:36 +00:00
# --- welcome message ----------------------------------------------
CUSTOM_WELCOME="$HOME/.config/wryn/welcome"
2020-12-02 19:14:36 +00:00
[ -f "$CUSTOM_WELCOME" ] \
&& { source "$CUSTOM_WELCOME" } \
|| { { figlet 'Welcome, beautiful'; cowsay -p 'damn u sexy' } | lolcat; }