查看当前已安装的shell
cat /etc/shells
更新软件包,确保安装了wget
apt-get update
apt-get upgrade
apt-get install -y wget
apt-get install -y vim
使用wget获取快捷安装脚本,脚本从oh my zsh官网获得,
笔者将其源改成了gitee,加快访问和下载速度
wget https://gitee.com/heyuanfly/ohmyzsh/raw/master/ubuntu-install-oh-my-zsh.sh
获得安装脚本后,改变其权限,使其可以执行,然后直接执行即可
chmod +x ubuntu-install-oh-my-zsh.sh
./ubuntu-install-oh-my-zsh.sh
此时,oh my zsh 已经安装成功,下面改变主题(可选)
笔者改成ys主题,感觉不错,agnoster 也不错
改成random也可,其会随机的选择主题
vim ~/.zshrc
找到 ZSH_THEME="robbyrussell"
改为 ZSH_THEME="ys"
:wq #保存退出
source .zshrc #刷新文件,使其生效
zsh #重新进入zsh,即可看到效果
改变默认shell为zsh
chsh -s /bin/zsh
安装智能高亮和自动补全插件,执行以下命令
git clone https://gitee.com/heyuanfly/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://gitee.com/heyuanfly/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc
找到plugins=(git)
,将其改为
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
然后保存退出,刷新,重新进入zsh即可
:wq
source .zshrc
zsh