Ubuntu安装Oh My Zsh

1. 安装ZSH

sudo apt-get install zsh

安装完后需要注销或重启才能生效。注销或重启后打开终端,会出现ZSH的界面,选择(2)

2. 安装Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

或

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

3. 配置Oh My Zsh

安装完后是默认的主题“robbyrussell”,要想修改主题或其他配置,可以修改“~/.zshrc”中的内容。这里我将主题修改为“agnoster”。

修改完后,输入命令source ~/.zshrc使得主题立即生效。

可用的主题请参见:https://github.com/robbyrussell/oh-my-zsh/wiki/themes

4. 解决乱码问题

对于Oh My Zsh中的某些主题,可能会出现乱码的现象,这是因为系统中没有安装该主题用到的字体,一般安装powerline font即可解决乱码。
对于Ubuntu,使用sudo apt-get install fonts-powerline即可安装,安装完后重启终端就不会出现乱码了。

对于其他平台安装Powerline字体的方法参见:https://github.com/powerline/fonts

posted @ 2018-10-03 14:06  RivW  阅读(206)  评论(0编辑  收藏  举报