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