2022-03-13 13:05:41 +01:00
|
|
|
|
|
|
|
# Directory for all-things ZSH config
|
|
|
|
zsh_dir=${${ZDOTDIR}:-$HOME/.config/zsh}
|
2022-03-19 22:32:31 +01:00
|
|
|
utils_dir=~/.config/utils
|
2022-03-13 13:05:41 +01:00
|
|
|
|
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
# Import alias files
|
2022-03-13 23:43:08 +01:00
|
|
|
source ${zsh_dir}/aliases/general.zsh
|
2022-03-18 21:36:53 +01:00
|
|
|
source ${zsh_dir}/aliases/git.zsh
|
2022-03-19 22:32:31 +01:00
|
|
|
source ${zsh_dir}/aliases/node-js.zsh
|
2022-08-06 13:37:55 +02:00
|
|
|
source ${zsh_dir}/aliases/flutter.zsh
|
2022-10-31 18:20:41 +01:00
|
|
|
source ${zsh_dir}/aliases/alias-tips.zsh
|
2022-03-13 13:05:41 +01:00
|
|
|
|
2022-03-19 22:32:31 +01:00
|
|
|
# Setup Antigen, and import plugins
|
2022-03-13 13:05:41 +01:00
|
|
|
source ${zsh_dir}/helpers/setup-antigen.zsh
|
|
|
|
source ${zsh_dir}/helpers/import-plugins.zsh
|
2022-11-07 00:59:18 +01:00
|
|
|
source ${zsh_dir}/helpers/misc-stuff.zsh
|
2022-03-13 13:05:41 +01:00
|
|
|
|
2022-03-16 00:37:54 +01:00
|
|
|
# Configure ZSH stuff
|
|
|
|
source ${zsh_dir}/lib/colors.zsh
|
2022-03-20 22:07:13 +01:00
|
|
|
source ${zsh_dir}/lib/cursor.zsh
|
|
|
|
source ${zsh_dir}/lib/history.zsh
|
|
|
|
source ${zsh_dir}/lib/surround.zsh
|
2022-03-16 00:37:54 +01:00
|
|
|
source ${zsh_dir}/lib/completion.zsh
|
|
|
|
source ${zsh_dir}/lib/term-title.zsh
|
2022-03-19 22:32:31 +01:00
|
|
|
source ${zsh_dir}/lib/navigation.zsh
|
2022-03-20 22:07:13 +01:00
|
|
|
source ${zsh_dir}/lib/expansions.zsh
|
2022-03-16 00:37:54 +01:00
|
|
|
source ${zsh_dir}/lib/key-bindings.zsh
|
|
|
|
|
2022-03-19 22:32:31 +01:00
|
|
|
# Import utility functions
|
|
|
|
source ${utils_dir}/transfer.sh
|
2022-03-20 22:07:13 +01:00
|
|
|
source ${utils_dir}/matrix.sh
|
2022-03-19 22:32:31 +01:00
|
|
|
source ${utils_dir}/hr.sh
|
2022-08-06 13:37:55 +02:00
|
|
|
source ${utils_dir}/web-search.sh
|
|
|
|
source ${utils_dir}/am-i-online.sh
|
2022-08-06 21:24:34 +02:00
|
|
|
source ${utils_dir}/welcome-banner.sh
|
2022-09-01 20:45:56 +02:00
|
|
|
source ${utils_dir}/color-map.sh
|
2022-03-19 22:32:31 +01:00
|
|
|
|
2022-03-13 13:05:41 +01:00
|
|
|
# Import P10k config for command prompt, run `p10k configure` or edit
|
|
|
|
[[ ! -f ${zsh_dir}/.p10k.zsh ]] || source ${zsh_dir}/.p10k.zsh
|
2022-08-06 21:24:34 +02:00
|
|
|
|
2022-11-07 00:59:18 +01:00
|
|
|
# Add Brew to path, if installed and on MacOS
|
|
|
|
if [ "$(uname -s)" = "Darwin" ] && [[ -d /opt/homebrew/bin ]]; then
|
|
|
|
export PATH=/opt/homebrew/bin:$PATH
|
|
|
|
fi
|
|
|
|
|
2022-11-11 19:38:41 +01:00
|
|
|
# If using iTerm on MacOS, import the shell integration
|
|
|
|
if [ "$(uname -s)" = "Darwin" ] && [[ -f "${XDG_CONFIG_HOME}/zsh/.iterm2_shell_integration.zsh" ]]; then
|
|
|
|
source ${XDG_CONFIG_HOME}/iterm/shell-integration.zsh
|
|
|
|
fi
|
|
|
|
|
2022-11-07 00:59:18 +01:00
|
|
|
# And Android SDK to path, if within Library direcroty
|
|
|
|
if [ "$(uname -s)" = "Darwin" ] && [[ -d "${HOME}/Library/Android/" ]]; then
|
|
|
|
export PATH="${HOME}/Library/Android/sdk/emulator:${PATH}"
|
|
|
|
export ANDROID_HOME="${HOME}/Library/Android/sdk"
|
|
|
|
export ANDROID_SDK_ROOT="${HOME}/Library/Android/sdk"
|
|
|
|
export ANDROID_AVD_HOME="${ANDROID_SDK_ROOT}/tools/emulator"
|
|
|
|
export NODE_BINARY="/usr/local/bin/node"
|
|
|
|
fi
|
|
|
|
|
2022-08-12 18:20:15 +02:00
|
|
|
# If not running in nested shell, then show welcome message :)
|
2022-09-23 18:37:34 +02:00
|
|
|
if [[ "${SHLVL}" -lt 2 ]] && [[ -z "$SKIP_WELCOME" ]]; then
|
2022-08-12 18:20:15 +02:00
|
|
|
welcome
|
|
|
|
fi
|