Ubuntu 22.04 LTS
查看当前shell
echo $SHELL
安装zsh
sudo apt-get install zsh
切换到zsh
chsh -s /bin/zsh
重启后检查shell
安装oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
更换主题
vim ~/.zshrc
添加
export ZSH="$HOME/.oh-my-zsh"
指定主题为oh-my-zsh
修改主题
改为ZSH_THEME="random",每次启动随机一个主题
source ~/.zshrc
安装插件
在.zshrc文件plugins括号中添加
自动补全 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://gitee.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
历史指令zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
source ~/.zshrc