ubuntu22.04配置zsh
1.安装zsh
sudo apt install zsh # 安装
chsh -s /bin/zsh # 启用zsh
安装完成后需要重启才能生效
2.安装oh my zsh
国外:
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
国内
sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"
3.配置自动补全
手动配置
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
打开~/.zshrc进行编辑
最后一行增加
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
oh my zsh配置方法
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
在plugins中添加
plugins=(git
zsh-autosuggestions
)
修改主题
ZSH_THEME="random"
个人比较喜欢
ZSH_THEME="mikeh"
或者其他自己喜欢的主题 https://github.com/ohmyzsh/ohmyzsh/wiki/Themes