init with on-my-zsh install

This commit is contained in:
Yingjie Wang 2024-02-26 13:01:59 -05:00
commit a074ad341f
2 changed files with 17 additions and 0 deletions

16
install-zsh.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 安装 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 安装 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 备份原始的 .zshrc 文件
cp ~/.zshrc ~/.zshrc.backup
# 使用 sed 命令查找 plugins= 开头的行,并在行末尾的 ) 前添加额外的插件
sed -i '/^plugins=(/s/)$/ z sudo zsh-autosuggestions zsh-syntax-highlighting&/' ~/.zshrc

1
install.sh Normal file
View File

@ -0,0 +1 @@
./install-zsh.sh