121 lines
3.4 KiB
Plaintext
121 lines
3.4 KiB
Plaintext
alias ll='ls -alhG'
|
|
|
|
# Starship prompt
|
|
eval "$(starship init zsh)"
|
|
|
|
# zsh-autosuggestions 自动补全
|
|
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
|
|
# NVM 懒加载 - 只在第一次使用相关命令时再初始化
|
|
export NVM_DIR="$HOME/.nvm"
|
|
_nvm_default_bin() {
|
|
local default_alias version_dir
|
|
[ -r "$NVM_DIR/alias/default" ] || return 1
|
|
|
|
default_alias="$(<"$NVM_DIR/alias/default")"
|
|
default_alias="${default_alias#"${default_alias%%[![:space:]]*}"}"
|
|
default_alias="${default_alias%"${default_alias##*[![:space:]]}"}"
|
|
|
|
case "$default_alias" in
|
|
v[0-9]*)
|
|
version_dir="$NVM_DIR/versions/node/$default_alias"
|
|
;;
|
|
[0-9]*)
|
|
version_dir="$(ls -d "$NVM_DIR"/versions/node/v"$default_alias".* 2>/dev/null | tail -n 1)"
|
|
;;
|
|
node|stable|lts/*)
|
|
version_dir="$(ls -d "$NVM_DIR"/versions/node/v* 2>/dev/null | sort -V | tail -n 1)"
|
|
;;
|
|
*)
|
|
return 1
|
|
;;
|
|
esac
|
|
|
|
[ -n "$version_dir" ] && [ -x "$version_dir/bin/node" ] || return 1
|
|
printf '%s\n' "$version_dir/bin"
|
|
}
|
|
if _nvm_default_node_bin="$(_nvm_default_bin)"; then
|
|
export PATH="$_nvm_default_node_bin:$PATH"
|
|
fi
|
|
unset _nvm_default_node_bin
|
|
_lazy_load_nvm() {
|
|
unset -f nvm node npm npx pnpm yarn 2>/dev/null
|
|
[ -s "$NVM_DIR/nvm.sh" ] || return 1
|
|
\. "$NVM_DIR/nvm.sh"
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
hash -r 2>/dev/null
|
|
}
|
|
nvm() { _lazy_load_nvm && nvm "$@"; }
|
|
node() { _lazy_load_nvm && node "$@"; }
|
|
npm() { _lazy_load_nvm && npm "$@"; }
|
|
npx() { _lazy_load_nvm && npx "$@"; }
|
|
pnpm() { _lazy_load_nvm && pnpm "$@"; }
|
|
yarn() { _lazy_load_nvm && yarn "$@"; }
|
|
export PATH="/Applications/EServer/bin:$PATH"
|
|
function EC_start(){
|
|
/Applications/EasyConnect.app/Contents/Resources/bin/EasyMonitor > /dev/null 2>&1 &
|
|
/Applications/EasyConnect.app/Contents/MacOS/EasyConnect > /dev/null 2>&1 &
|
|
open /Applications/EasyConnect.app
|
|
}
|
|
|
|
function EC_kill(){
|
|
pkill EasyMonitor
|
|
pkill ECAgent
|
|
pkill ECAgentProxy
|
|
pkill EasyConnect
|
|
}
|
|
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
|
|
fpath=(/Users/long/.docker/completions $fpath)
|
|
autoload -Uz compinit
|
|
compinit
|
|
# End of Docker CLI completions
|
|
|
|
|
|
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/
|
|
|
|
# pyenv 懒加载 - 只在第一次使用 Python 相关命令时再初始化
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
|
_lazy_load_pyenv() {
|
|
unset -f pyenv python python3 pip pip3 2>/dev/null
|
|
|
|
local pyenv_bin
|
|
pyenv_bin="$(command -v pyenv 2>/dev/null)"
|
|
if [ -z "$pyenv_bin" ] && [ -x /opt/homebrew/bin/pyenv ]; then
|
|
pyenv_bin=/opt/homebrew/bin/pyenv
|
|
fi
|
|
|
|
[ -n "$pyenv_bin" ] || return 1
|
|
|
|
eval "$("$pyenv_bin" init --path)"
|
|
eval "$("$pyenv_bin" init - zsh)"
|
|
hash -r 2>/dev/null
|
|
}
|
|
pyenv() { _lazy_load_pyenv && pyenv "$@"; }
|
|
python() { _lazy_load_pyenv && python "$@"; }
|
|
python3() { _lazy_load_pyenv && python3 "$@"; }
|
|
pip() { _lazy_load_pyenv && pip "$@"; }
|
|
pip3() { _lazy_load_pyenv && pip3 "$@"; }
|
|
|
|
# 引入 bash 配置
|
|
if [ -f ~/.bash_profile ]; then
|
|
source ~/.bash_profile
|
|
fi
|
|
if [ -f ~/.bashrc ]; then
|
|
source ~/.bashrc
|
|
fi
|
|
|
|
# Added by Windsurf
|
|
export PATH="/Users/long/.codeium/windsurf/bin:$PATH"
|
|
|
|
# Added by Antigravity
|
|
export PATH="/Users/long/.antigravity/antigravity/bin:$PATH"
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
# MindOS Desktop — CLI (mindos)
|
|
export PATH="$HOME/.mindos/bin:$PATH"
|
|
|
|
source "$HOME/.cargo/env"
|
|
|
|
# Added by Antigravity
|
|
export PATH="/Users/long/.antigravity/antigravity/bin:$PATH"
|