41 lines
1.2 KiB
Bash
41 lines
1.2 KiB
Bash
#!/bin/zsh
|
|
|
|
source "$HOME/.wryn/env/env.zsh"
|
|
|
|
RC_DIR="$DOTWRYN/zsh"
|
|
|
|
# --- load custom plugins ------------------------------------------
|
|
|
|
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
|
|
|
|
|
|
# --- set default editor -------------------------------------------
|
|
SET_PREFERRED_EDITOR() {
|
|
# load preference from environment (vi vim) by default
|
|
[[ -z $PREFERRED_EDITOR ]] && { echo 'unable to find $PREFERRED_EDITOR environment variable'; return 1; }
|
|
|
|
[[ $EDITOR == "${PREFERRED_EDITOR[-1]}" ]] && [[ $VISUAL == "${PREFERENCE[-1]}" ]] && return 0;
|
|
|
|
local AVAILABLE_EDITOR="$EDITOR";
|
|
|
|
for program in $PREFERRED_EDITOR; do which $program >/dev/null 2>&1 && AVAILABLE_EDITOR="$program"; done
|
|
|
|
export EDITOR="$AVAILABLE_EDITOR";
|
|
export VISUAL="$AVAILABLE_EDITOR";
|
|
}
|
|
SET_PREFERRED_EDITOR
|
|
|
|
|
|
# --- welcome message ----------------------------------------------
|
|
exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat;
|