安装配置oh-my-zsh

1.下载安装iterm:https://www.iterm2.com/

2.安装zsh

查看系统当前使用的shell

$ echo $SHELL
/bin/bash

查看系统是否安装了zsh

$ cat /etc/shells 
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
/bin/zsh   //有这个表明安装过了

没有就安装oh-my-sh:http://ohmyz.sh/
查看zsh版本:zsh --version 出现如下版本号即为安装成功

这里写图片描述

3.切换shell为zsh

$ chsh -s /bin/zsh
Changing shell for root.

关闭窗口,重新打开iterm,查看当前shell

$ echo $SHELL
/bin/zsh

4.修改主题

$ vim ~/.zshrc

找到ZSH_THEME='XXX'这里XXX表示主题名 更改为你想换的主题名就可

更新配置

$ source ~/.zshrc

5.语法高亮

(1).安装 zsh-syntax-highlighting 插件

brew install zsh-syntax-highlighting

(2).配置.zshrc文件,插入一行。

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
plugins=(zsh-syntax-highlighting) 

(3).更新配置

$ source ~/.zshrc

6.安装完成后之node等全局变量不可用

1.在.bash_profile最后增加一行

export PATH=/bin:/usr/bin:/usr/local/bin:"${PATH}"

然后在.zshrc文件最后增加一行

source ~/.bash_profile

保存重启终端窗口

posted @ 2018-05-13 17:50  我在等风也等你啊  阅读(129)  评论(0编辑  收藏  举报