Split zsh config into dotfiles fragments

This commit is contained in:
2026-03-08 16:24:26 +08:00
parent 87ac9027ed
commit a958814bb3
7 changed files with 80 additions and 21 deletions
+5
View File
@@ -0,0 +1,5 @@
path_prepend "${HOME}/.local/bin"
path_prepend "${HOME}/work/codes/tools/macos/ai"
path_append "${HOME}/work/tools/flutter/bin"
export PATH
+3 -21
View File
@@ -1,27 +1,9 @@
export CLASH_HTTP_PROXY="${CLASH_HTTP_PROXY:-http://127.0.0.1:7890}"
export CLASH_HTTPS_PROXY="${CLASH_HTTPS_PROXY:-http://127.0.0.1:7890}"
export CLASH_ALL_PROXY="${CLASH_ALL_PROXY:-socks5://127.0.0.1:7890}"
export CLASH_NO_PROXY="${CLASH_NO_PROXY:-localhost,127.0.0.1,::1}"
codex() {
HTTP_PROXY="${CLASH_HTTP_PROXY}" \
HTTPS_PROXY="${CLASH_HTTPS_PROXY}" \
ALL_PROXY="${CLASH_ALL_PROXY}" \
http_proxy="${CLASH_HTTP_PROXY}" \
https_proxy="${CLASH_HTTPS_PROXY}" \
all_proxy="${CLASH_ALL_PROXY}" \
NO_PROXY="${CLASH_NO_PROXY}" \
no_proxy="${CLASH_NO_PROXY}" \
command codex "$@"
}
codex-direct() {
local codex_bin
codex_bin="$(whence -p codex)"
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u NO_PROXY \
-u http_proxy -u https_proxy -u all_proxy -u no_proxy \
"${codex_bin}" "$@"
}
export CLASH_NO_PROXY="${CLASH_NO_PROXY:-localhost,127.0.0.1,::1,*.local,192.168.*,10.*,172.16.*}"
export NO_PROXY="${NO_PROXY:-${CLASH_NO_PROXY}}"
export no_proxy="${no_proxy:-${CLASH_NO_PROXY}}"
clash-on() {
export HTTP_PROXY="${CLASH_HTTP_PROXY}"
+40
View File
@@ -0,0 +1,40 @@
export GO111MODULE="${GO111MODULE:-on}"
export GOPROXY="${GOPROXY:-https://goproxy.cn}"
export BUN_INSTALL="${BUN_INSTALL:-${HOME}/.bun}"
if [[ -s "${BUN_INSTALL}/_bun" ]]; then
source "${BUN_INSTALL}/_bun"
fi
path_prepend "${BUN_INSTALL}/bin"
export NVM_DIR="${NVM_DIR:-${HOME}/.nvm}"
if [[ -s "${NVM_DIR}/nvm.sh" ]]; then
. "${NVM_DIR}/nvm.sh"
fi
if [[ -s "${NVM_DIR}/bash_completion" ]]; then
. "${NVM_DIR}/bash_completion"
fi
export PNPM_HOME="${PNPM_HOME:-${HOME}/Library/pnpm}"
path_prepend "${PNPM_HOME}"
path_prepend "${HOME}/.jenv/bin"
if command -v jenv >/dev/null 2>&1; then
eval "$(jenv init -)"
fi
export JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home}"
path_prepend "/opt/homebrew/opt/openjdk@21/bin"
path_prepend "${JAVA_HOME}/bin"
venv() {
if [[ -z "${1:-}" ]]; then
echo "Please provide a name for the virtual environment."
return 1
fi
python3 -m venv "$1" && source "$1/bin/activate"
}
export PATH
+5
View File
@@ -0,0 +1,5 @@
export OLLAMA_HOST="${OLLAMA_HOST:-0.0.0.0:11434}"
export OLLAMA_ORIGINS="${OLLAMA_ORIGINS:-*}"
export GIT_CREDENTIAL_STORE="${GIT_CREDENTIAL_STORE:-}"
export GIT_TERMINAL_PROMPT="${GIT_TERMINAL_PROMPT:-0}"
export DOCKER_BUILDKIT="${DOCKER_BUILDKIT:-1}"
+18
View File
@@ -1 +1,19 @@
alias codex-proxy-status='printf "HTTP_PROXY=%s\nHTTPS_PROXY=%s\nALL_PROXY=%s\n" "${HTTP_PROXY:-}" "${HTTPS_PROXY:-}" "${ALL_PROXY:-}"'
alias ollama-local='env -u http_proxy -u https_proxy -u all_proxy -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY ollama'
alias kubectl='/Users/brunogao/work/codes/tools/macos/k8s/kubectl-auto-fix'
alias cdljwx='cd /Users/brunogao/work/codes/health/ljwx/yunxiang/'
alias pcc-start='/Users/brunogao/work/codes/ljwx/ljwx-project/scripts/pcc-agent-report.sh start'
alias pcc-progress='/Users/brunogao/work/codes/ljwx/ljwx-project/scripts/pcc-agent-report.sh progress'
alias pcc-complete='/Users/brunogao/work/codes/ljwx/ljwx-project/scripts/pcc-agent-report.sh complete'
alias pcc-status='/Users/brunogao/work/codes/ljwx/ljwx-project/scripts/pcc-agent-report.sh status'
alias pcc-config='/Users/brunogao/work/codes/ljwx/ljwx-project/scripts/pcc-agent-report.sh config'
alias vnc3k='displayplacer "id:50AEDA84-525C-41A7-8919-157C070FD63F res:2880x1800 hz:60 color_depth:4 enabled:true origin:(0,0) degree:0" && echo "Set to 3K (2880x1800)"'
alias vnc2k='displayplacer "id:50AEDA84-525C-41A7-8919-157C070FD63F res:2624x1696 hz:60 color_depth:4 enabled:true origin:(0,0) degree:0" && echo "Set to 2K+ (2624x1696)"'
alias vnc1080='displayplacer "id:50AEDA84-525C-41A7-8919-157C070FD63F res:1920x1080 hz:60 color_depth:4 enabled:true origin:(0,0) degree:0" && echo "Set to 1080p (1920x1080)"'
alias vncstatus='displayplacer list | grep "current mode"'
alias vnchidpi='echo "Run:" && echo " cd ~/work/codes/tools/macos/network && ./setup-hidpi-display.sh open"'
alias vi='nvim'
alias vim='nvim'
+7
View File
@@ -0,0 +1,7 @@
for file in "${HOME}"/.config/secrets/*.zsh(N); do
source "${file}"
done
if [[ -r "${DOTFILES_ROOT}/zsh/90-machine.local.zsh" ]]; then
source "${DOTFILES_ROOT}/zsh/90-machine.local.zsh"
fi
+2
View File
@@ -4,3 +4,5 @@
# export JAVA_HOME="/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home"
# export ANTHROPIC_BASE_URL="https://example.internal/api"
# export CLASH_HTTP_PROXY="http://127.0.0.1:7890"
# alias vnc3k='displayplacer "...your monitor id..."'
# export DOCKER_HOST="unix://${HOME}/.orbstack/run/docker.sock"