Linux下安装oh my zsh 以及遇到的坑


遇到的坑

443... 失败:拒绝连接 问题

raw.githubusercontent.com (raw.githubusercontent.com)|:😐:443... 失败:拒绝连接

https://blog.csdn.net/wowbing2/article/details/105797442

修改hosts即可

sudo vi /etc/hosts
151.101.108.133	raw.githubusercontent.com

1.安装zsh包

yum -y install zsh

2.切换默认shell为zsh

chsh -s /bin/zsh

3.重启服务器让修改的配置生效

这个没什么好多说的,我习惯在web端控制台直接重启。

4.安装on my zsh

curl安装

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

![image-20200428120301471](/Users/z/Library/Application Support/typora-user-images/image-20200428120301471.png)

wget安装

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

到这一步 oh my zsh 已经安装完成。

5.修改oh my zsh 主题

查看oh my zsh主题
ls ~/.oh-my-zsh/themes

6.安装插件

vi ~/.zshrc

#autosuggestions	自动提示

git clone git://github.com/zsh-users/zsh-autosuggestions $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

git clone git://github.com/joelthelion/autojump.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/autojump

7.设置默认终端

显示存在的bash

cat /etc/shells

取代bash,设为默认shell

sudo usermod -s /bin/zsh username

或者

chsh -s `which zsh`

如果要切换回去bash

chsh -s /bin/bash

当然你实在不愿意把zsh当成默认的shell, 而又想使用它, 那么你可以每次进入是都使用zsh进入, 而输入exit退出

卸载 oh-my-zsh

进入到.oh-my-zsh/tools目录

cd .oh-my-zsh/tools
chmod +x uninstall.sh
./uninstall.sh
rm -rif .zshrc

参考:

Linux终极shell-Z Shell--用强大的zsh & oh-my-zsh把Bash换掉


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM