2018-06-15 13:43:04 +00:00
|
|
|
#!/usr/bin/env zsh
|
2018-02-23 09:38:24 +00:00
|
|
|
|
|
|
|
find_dotfiles_dir() {
|
2018-02-23 17:15:26 +00:00
|
|
|
export DOTFILES_DIR
|
2018-02-23 09:38:24 +00:00
|
|
|
|
2018-02-23 17:15:26 +00:00
|
|
|
for prefix in "$HOME/." "/usr/share/" "/usr/local/share/"; do
|
|
|
|
DOTFILES_DIR="${prefix}dotfiles"
|
|
|
|
[[ -d "$DOTFILES_DIR" ]] && return
|
|
|
|
done
|
2018-02-23 09:38:24 +00:00
|
|
|
|
2018-07-04 20:55:45 +00:00
|
|
|
local script_path="$(realpath "${(%):-%x}")"
|
|
|
|
DOTFILES_DIR="$(dirname "$script_path")"
|
2018-02-23 09:38:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
find_dotfiles_dir
|
|
|
|
|
2018-07-04 20:56:09 +00:00
|
|
|
for script in functions path exports aliases oh-my-zsh widgets; do
|
|
|
|
source "${DOTFILES_DIR}/${script}.zsh"
|
2018-02-23 09:38:24 +00:00
|
|
|
done
|
|
|
|
|
2018-07-04 20:56:09 +00:00
|
|
|
source_if_exists "$ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh"
|
2018-06-15 13:50:24 +00:00
|
|
|
run_before rbenv 'eval "$(rbenv init -)"'
|
|
|
|
run_before sdk 'source_if_exists "$SDKMAN_DIR/bin/sdkman-init.sh"'
|
|
|
|
run_before yarn 'source_if_exists "$(yarn global dir)/node_modules/tabtab/.completions/yarn.zsh"'
|