dotwryn/zsh/rc

41 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-12-02 17:16:05 +00:00
#!/bin/zsh
2020-09-17 03:06:44 +00:00
2020-01-08 19:40:53 +00:00
source "$HOME/.wryn/env/env.zsh"
2019-12-02 17:16:05 +00:00
RC_DIR="$DOTWRYN/zsh"
# --- load custom plugins ------------------------------------------
2019-12-02 17:16:05 +00:00
for file in $(find $RC_DIR -maxdepth 1 -type f ! -name 'rc'); do source $file; done;
# operating system specific plugins
case "$OSTYPE" in
linux-gnu )
for file in $(find $RC_DIR/linux -type f); do source $file; done;
;;
darwin* )
for file in $(find $RC_DIR/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
2020-11-04 19:57:36 +00:00
# --- welcome message ----------------------------------------------
exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat;