-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
executable file
·38 lines (30 loc) · 1.13 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# .zshrc is a symlink to .zshrc in this repo wherever it is cloned on disk
export DOT_FILES_PATH=$(dirname $(readlink ~/.zshrc))
export DOT_DOT_PATH="${DOT_FILES_PATH}/dot"
export DOT_TOOLS_PATH="${DOT_FILES_PATH}/tools"
source "${DOT_FILES_PATH}/dot/common.sh"
source "${DOT_FILES_PATH}/dot/load.sh"
# workspaces is either in ~/Projects or in codespaces it's in /codespaces
export DOT_WORKSPACE_PATH="${HOME}/Projects"
if [ -d "/workspaces" ]; then
# codespaces
DOT_WORKSPACE_PATH="/workspaces"
fi
export DOT_PRIV_PATH="${DOT_WORKSPACE_PATH}/dotprivate"
clear
"${DOT_FILES_PATH}/dot/welcome.sh"
# https://scriptingosx.com/2019/07/moving-to-zsh-06-customizing-the-zsh-prompt/
PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{250}%1~%f%b %(!.#.$) '
dot_load
dot_help
dot_tools "init"
# codespaces automatically takes you into that repo.
# else, lets start in the root of our workspaces directory (the w alias)
# on reload keep same dir (it writes a .curr file)
if [ -f "${DOT_FILES_PATH}/.curr" ]; then
curr_dir=$(cat "${DOT_FILES_PATH}/.curr")
cd "${curr_dir}"
rm -rf .curr > /dev/null
elif [ -z "${CODESPACES}" ]; then
w
fi