mac M1 安装brew item2 Oh My Zsh

安装brew

执行gitee安装脚本

/bin/zsh -c "$(curl -fsSL https://gitee.com/huwei1024/HomebrewCN/raw/master/Homebrew.sh)"

问题处理记录:

添加环境变量

vim ~/.zshrc

export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH

source ~/.zshrc

安装 iTem2

  • iTerms2 下载地址点击这里:https://iterm2.com/

  • iterm2的设置里选择 profiles --> colors 中选择 Solarized Dark

安装 Oh My Zsh

Oh My Zsh是一个开源的、社区驱动的框架,用于管理您的Zsh配置。

官网提供的安装方式:

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

设置主题
打开~/.zshrc文件后将 ZSH_THEME="robbyrussell"修改为ZSH_THEME="agnoster"

命令提示和语法高亮插件安装

安装历史命令提示插件

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

安装语法高亮插件

git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

配置插件,修改 .zshrc

vim ~/.zshrc
# 在文件里找到plugins,修改为
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

处理文字有乱码情况

解决乱码,下载Powerline字体,安装后可以删除这个git项目

// clone 克隆
git clone https://github.com/powerline/fonts.git
// install 安装
cd fonts
./install.sh

安装完字体库之后,把iTerm 2的设置中的 Profile 中的 Text 选项卡中里的、 Font 和 Non-ASCII Font的字体都设置成 Powerline的字体,我这里设置的字体是 Meslo LG S DZ for Powerline

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容