zsh安装

zsh安装1.aptinstall-yzshaptinstall-ygit2.下载码云安装包wgethttps://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.shchmod777install.sh3.编辑install.sh找到以下部分ZSH=ZSH:− /.oh−my−zshREPO={ZSH:-~/.oh-my-zsh}REPO=ZSH:− /.oh−my−zshREPO={REPO:-

1.

apt install -y zsh
apt install -y git

2.

下载码云安装包

wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
chmod 777 install.sh

3.

编辑install.sh 找到以下部分

ZSH= Z S H : −   / . o h − m y − z s h R E P O = {ZSH:-~/.oh-my-zsh} REPO= ZSH: /.ohmyzshREPO={REPO:-ohmyzsh/ohmyzsh}
REMOTE=KaTeX parse error: Expected ‘}’, got ‘EOF’ at end of input: …s://github.com/{REPO}.git}
BRANCH=${BRANCH:-master}

REPO= R E P O : − o h m y z s h / o h m y z s h R E M O T E = {REPO:-ohmyzsh/ohmyzsh} REMOTE= REPO:ohmyzsh/ohmyzshREMOTE={REMOTE:-https://github.com/${REPO}.git}
替换为

REPO= R E P O : − m i r r o r s / o h − m y − z s h R E M O T E = {REPO:-mirrors/oh-my-zsh} REMOTE= REPO:mirrors/ohmyzshREMOTE={REMOTE:-https://gitee.com/${REPO}.git}

sed -i 's/REPO=\${REPO:-ohmyzsh\/ohmyzsh}/REPO=\${REPO:-mirrors\/oh-my-zsh}/' install.sh
sed -i 's/github.com/gitee.com/' install.sh

4.

启动

bash install.sh

5.

修改zshrc
vim ~/.zshrc

ZSH_THEME=“agnoster”
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

6.

安装插件

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

7.

启动

source ~/.zshrc

整合

#安装依赖
#apt install -y zsh
#apt install -y git

yum install -y zsh
yum install -y git

#下载脚本
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
chmod 777 install.sh

#替换源
sed -i 's/REPO=\${REPO:-ohmyzsh\/ohmyzsh}/REPO=\${REPO:-mirrors\/oh-my-zsh}/' install.sh
sed -i 's/github.com/gitee.com/' install.sh

#安装ohmyzsh
bash install.sh

#修改配置文件 可能失效
############################################
cat>~/.zshrc<<EOF
export ZSH="~/.oh-my-zsh"
ZSH_THEME="agnoster"
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
EOF
############################################

#安装插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
#生效配置
source ~/.zshrc

今天的文章zsh安装分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/5746.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注