配置oh-my-zsh和主题
更改默认shell
chsh -s /usr/bin/zsh
配置oh-my-zsh
github hosts文件更改
sudo nano /etc/hosts
添加字段:
# GitHub Start
151.101.76.133 raw.githubusercontent.com
# GitHub End
下载oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
安装高亮功能
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/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
修改配置文件,以启用功能
nano ~/.zshrc
插件改为:
plugins=(git zsh-syntax-highlighting zsh-autosuggestions sudo extract)
执行source ~/.zshrc
配置主题(Powerlevel-10k)
git命令克隆:
github:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
gitee:
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
修改配置文件
nano ~/.zshrc
主题改为
ZSH_THEME="powerlevel10k/powerlevel10k"
想要启用主题中的图标,需要安装nerd
字体
比如Arch-Linux中的nerd-fonts-hack
,nerd-fonts-source-code-pro
等
重启并按照步骤个性化设置