Day Background Night Background
服务器优化zsh外观简易版

服务器优化zsh外观简易版

一键配置命令

# 1. 安装依赖
if command -v apt-get >/dev/null 2>&1; then
  apt-get update
  apt-get install -y zsh git curl
fi

# 2. 备份原来的 zsh 配置
cp ~/.zshrc ~/.zshrc.bak.$(date +%Y%m%d_%H%M%S) 2>/dev/null || true

# 3. 安装 oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
  git clone https://github.com/ohmyzsh/ohmyzsh.git "$HOME/.oh-my-zsh"
fi

# 4. 写入 oh-my-zsh 基础配置
cat > ~/.zshrc <<'EOF'
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"

plugins=(git)

source $ZSH/oh-my-zsh.sh
EOF

# 5. 初始化 conda 到 zsh
conda init zsh

# 6. 保持 conda 默认 prompt 行为,避免影响 bash/base
conda config --set changeps1 true

# 7. 进入 zsh
exec zsh

服务器优化zsh外观简易版

https://ryanjxy123.github.io/post/share_somethings/env_configuration/zsh_config/

Author
Ryanjxy
Published at
May 5, 2026
Copyright
Ryanjxy