From a074ad341f946b803f5b3324291aa2085a1f1654 Mon Sep 17 00:00:00 2001 From: GaugeAndGravity Date: Mon, 26 Feb 2024 13:01:59 -0500 Subject: [PATCH] init with on-my-zsh install --- install-zsh.sh | 16 ++++++++++++++++ install.sh | 1 + 2 files changed, 17 insertions(+) create mode 100644 install-zsh.sh create mode 100644 install.sh diff --git a/install-zsh.sh b/install-zsh.sh new file mode 100644 index 0000000..0c96886 --- /dev/null +++ b/install-zsh.sh @@ -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 diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..74febd2 --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +./install-zsh.sh