1.linux 命令行
原来的镜像就带ohmyzsh
没有的话下载:(需要出海)
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
切换zsh
chsh -s /bin/zsh
==必须重启==
sudo reboot
1.1设置脚本
安装p10k
sudo git clone https://gitee.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
sudo git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
设置p10k主题
vim ~/.zshrc
同时设置好需要的脚本
必须按照这个顺序放在最后
1.2安装需要的脚本:
1.Autosuggestions
sudo git clone https://gitee.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sudo git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
2. zsh-syntax-highlighting
sudo git clone https://gitee.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
1.3让脚本生效
source ~/.zshrc
2.MobaXTerm端(显示ohmyzsh设置的关键)
2.1安装支持各种icon的字体(windows为例)
下载需要的字体,需要自己尝试,本文推荐jetbrian
https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip
为所有用户安装
2.2在MobaXterm客户端设置字体,设置关键的Terminal Type
首先要先设置好Terminal type 为256 这样才能保证p10k 能够显示 字体背景颜色,
然后在Terminal font setting 中设置安装好的nerd font 字体如图所示
可以通过p10k configure 就可以看到
具体效果: