Linux終端美化
PS:本文以Ubuntu為操作,其他Linux也實(shí)用,由于一些原因github可能無法連接,可以用備選鏈接操作。

sudo apt install git
安裝zsh
1、安裝zsh
sudo apt install zsh
2、查詢
cat /etc/shells
3、設(shè)置為默認(rèn)shell
chsh -s /usr/bin/zsh
4、退出重啟終端
exit
安裝Oh-my-zsh
安裝Oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
備選
sh -c "$(wget https://raw.fastgit.org/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
安裝主題
1、安裝powerlevel10k主題
?git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
備選
?git clone --depth=1 https://hub.fastgit.org/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
2、編輯vim ~/.zshrc
修改ZSH_THEME
ZSH_THEME="powerlevel10k/powerlevel10k"
3、重新配置powerlevel10k
p10k configure
4、執(zhí)行生效
source ~/.zshrc
安裝自動(dòng)補(bǔ)全
1、切換到
cd ~/.oh-my-zsh/custom/plugins/
2、克隆
git clone https://github.com/zsh-users/zsh-autosuggestions
備選
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-autosuggestions.git
或者
?git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
3、編輯vim ~/.zshrc
plugins添加zsh-autosuggestions
4、如果高亮不明顯
vim ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
修改為10
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
5、執(zhí)行生效
source ~/.zshrc
安裝高亮顯示
1、切換到
cd ~/.oh-my-zsh/custom/plugins/
2、克隆
git clone https://github.com/zsh-users/zsh-syntax-highlighting
備選
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-syntax-highlighting.git
或者
?git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
?echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
3、編輯vim ~/.zshrc
plugins添加zsh-syntax-highlighting
4、最后一行添加
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
5、執(zhí)行生效
source ~/.zshrc
6、注意點(diǎn)
在plugins將zsh-syntax-highlighting放最后
終端設(shè)置
打開終端-點(diǎn)擊“三杠”-配置文件首選項(xiàng)
文本和背景顏色:Solarized


錯(cuò)誤命令,紅色?