Skip to content

Instantly share code, notes, and snippets.

@wangshub
Last active June 14, 2025 02:23
Show Gist options
  • Select an option

  • Save wangshub/4d4767900a8c9d0e6affcf3e54059e5e to your computer and use it in GitHub Desktop.

Select an option

Save wangshub/4d4767900a8c9d0e6affcf3e54059e5e to your computer and use it in GitHub Desktop.
#!/bin/bash
# 安装Zsh
sudo apt update
sudo apt install -y zsh tree
# 设置Zsh为默认Shell
sudo chsh -s $(which zsh) $USER
# 安装Oh My Zsh(使用国内镜像加速)
export REMOTE=https://gitee.com/mirrors/oh-my-zsh.git
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)" "" --unattended
# 安装自动补全插件
git clone https://gitee.com/mirrors/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 配置插件
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/' ~/.zshrc
# 应用配置
source ~/.zshrc > /dev/null 2>&1
# 输出完成信息
echo -e "\n\033[32m安装完成!请重启终端或运行 exec zsh 生效\033[0m"
echo -e "推荐主题: agnoster (在 ~/.zshrc 中设置 ZSH_THEME=\"agnoster\")"
# 安装 Tmux 和推荐配置
sudo apt install -y tmux
cd
git clone --single-branch https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment