参考:Ubuntu 18.04 LTS下安装zsh和oh-my-zsh
一、安装zsh
查看系统当前使用的shell
echo $SHELL

查看系统已安装的shell
cat /etc/shells

更新apt-get
sudo apt-get update
安装zsh
sudo apt-get install -y zsh

切换默认shell为zsh
chsh -s /bin/zsh
reboot
重启后打开终端界面会显示首次使用zsh需要选择配置,先输入q选择离开配置。
二、安装oh-my-zsh
安装git
sudo apt install git

我转换zsh后名字不知道为啥变成这样了,不过可以正常用
安装oh-my-zsh
sh -c "$(wget -O- https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
emmmm...我用官方的下载不了,最后用的别人的链接关于ohmyzsh下载被443拒绝连接

三、主题修改
打开oh-my-zsh配置文件
vim ~/.zshrc
i进入输入模式,上下左右键将主题改为ZSH_THEME="ys",Esc退出编辑,:wq保存退出

更新配置
source ~/.zshrc

四、安装incr自动补全插件
下载插件
移动插件到oh-my-zsh目录的插件库下
sudo mkdir ~/.oh-my-zsh/plugins/incr/
sudo mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/incr-0.2.zsh
进入vim编辑
vim ~/.zshrc
在vim界面按i进入输入模式在末尾加上如下代码
source ~/.oh-my-zsh/plugins/incr/incr*.zsh
Esc退出编辑,:wq保存退出

更新配置
source ~/.zshrc
网友评论