安装并配置Zsh¶
安装Zsh¶
默认的Shell改成zsh¶
注意:不要使用sudo。
- 如果chsh: PAM认证失败,配置密码文件:
把对应用户/bin/bash改成/bin/zsh
安装Git¶
安装oh-my-zsh¶
安装插件¶
sudo apt-get install autojump
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
修改~/.zshrc
然后增加在 ~/.zshrc
最后一行:
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
配置主题¶
此处以我使用的主题为例,更多主题可以在Themes · ohmyzsh/ohmyzsh Wiki · GitHub找到并自行修改
git clone https://github.com/Egolas/agnosterj-zsh-theme
ln -s ~/agnosterj-zsh-theme/agnosterj.zsh-theme $ZSH/themes/agnosterj.zsh-theme
修改~/.zshrc
找到对应位置并修改:
生效: