mac安装配置zsh

mac安装配置zsh

比mac自带的shell好用太多

一、安装homebrew

参考:https://brew.sh/index_zh-cn

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

二、安装zsh

参考:https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH

brew install zsh

三、配置zsh终端

参考https://www.zhihu.com/question/21418449

curl -sSL https://raw.githubusercontent.com/skywind3000/vim/master/etc/zshrc.zsh >> .zshrc

三、安装 Zsh 扩展集合 oh-my-zsh

参考: jianshu.com/p/02276c671ee8
参考:https://github.com/ohmyzsh/ohmyzsh

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

然后安装相应的插件

参考:https://github.com/ohmyzsh/ohmyzsh
参考:https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins

编辑~/.zshrc,找到plugin,加入想要添加的插件

plugins=(git docker docker-compose)

然后source重新加载一下

source .zshrc

四、遇到的问题

Last login: Sun Sep  6 10:52:48 on ttys001
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

在这里插入图片描述
解决办法:

参考:https://github.com/zsh-users/zsh-completions/issues/433

$ cd /usr/local/share/
$ sudo chmod -R 755 zsh
$ sudo chown -R root:staff zsh

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_33317586/article/details/108429282