-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path.zshrc
More file actions
executable file
·55 lines (46 loc) · 1.71 KB
/
.zshrc
File metadata and controls
executable file
·55 lines (46 loc) · 1.71 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/zsh
# WARNING: tty isn't available from subshell so I set it here for later reference.
# It's referenced from inside of ~/.config/zsh/exports.zsh
tty_instance=$(tty)
function load_script {
local path=$1
if test -f $path; then
source $path
else
echo "no $path found"
fi
}
# IMPORTANT: $PATH in sourced scripts is the path to the script itself.
# So we assign the parent .zshrc PATH to MODIFIED_PATH and use that in sourced scripts.
# We do this by re-assigning PATH in the sourced script to MODIFIED_PATH.
# Then at the end of the sourced script we re-export the updated MODIFIED_PATH.
# Later on you'll see us prefix this .zshrc PATH with MODIFIED_PATH.
export MODIFIED_PATH="$PATH"
load_script ~/.config/zsh/options.zsh
load_script ~/.config/zsh/exports.zsh
load_script ~/.config/zsh/alias.zsh
load_script ~/.config/zsh/tools.zsh
load_script ~/.config/zsh/functions.zsh
load_script ~/.config/zsh/bindings.zsh
load_script ~/.config/zsh/shell.zsh
load_script ~/.config/zsh/autocomplete.zsh
export PATH="$MODIFIED_PATH:$PATH"
typeset -U path
echo .zshrc loaded
# Configuration you don't want as part of your main .zshrc
# For me, this is a template file that includes 1Password secret references.
# Meaning, I need to source the file via `op inject` so I can interpolate my secrets.
#
if [ -f "$HOME/.localrc" ]; then
if command -v op >/dev/null; then
op signin --account fastly.1password.com
# op signin --account my.1password.com << PERSONAL ACCOUNT
source <(op inject -i $HOME/.localrc)
fi
fi
# The following line is added automatically by humanlog if missing:
#
export PATH=$HOME/.humanlog/bin:$PATH
# The following line is required for aider
# curl -LsSf https://aider.chat/install.sh | sh
. "$HOME/.local/bin/env"