mac安装oh-my-zsh

1、 说明

linux与mac ox系统,shell类型默认都是bash, 在使用时候预发提示,页面美观等都不够强大,后来诞生了zsh,但zsh配置复杂,就有人在zsh基础开发出了 oh-my-zsh
下载地址: https://ohmyz.sh/#install

2、安装

官网安装方式:


image.png

终端执行如下命令:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

执行过程遇到443问题。

HQITI0010:.ssh shiyang.long$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

原因是使用了国外资源,改国内镜像安装

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

安装完成界面如下:

image.png

3、配置

(1)主题配置

  • oh-my-zsh 相关配置再 ~/.zshrc下。
 vim ~/.zshrc

编辑 ~/.zshrc中的 ZSH_THEME="xxx"即可。默认 :ZSH_THEME="robbyrussell"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"

更多主题查看github上的wiki:https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

  • 修改完成,执行配置文件生效即可
source ~/.zshrc

(2)插件配置
oh-my-zsh 自带插件都储存在 ~/.oh-my-zsh/plugins 目录中。

4、安装oh-my-zsh环境变量失效

【现象】:已经安装了maven , 在安装oh-my-zsh后,发现mvn命令提示:command not found: mvn
【原因】:~/.bash_profile文件不再执行
【方法】:将source ~/.bash_profile添加到 ~/.zshrc 即可。

image.png

你可能感兴趣的:(mac安装oh-my-zsh)