mac配置iTerm2、brew

       效果图:

        一:安装oh-my-zsh,官方有两种方式

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

# via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

        如果不行,在 👉oh-my-zsh GitHub 上下载,mac上默认就是下载到Download

cd ~/Downloads
mv ohmyzsh-master ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
source ~/.zshrc

        重启终端之后之后,打开 👉https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 更为直观的查看所有的配色方案

        1、接下来修改主题

vim ~/.zchrc
修改ZSH_THEME的值
保存退出
source ~/.zshrc

         2、然后需要打开 ~/.zshrc 设置 ZSH_THEME:

ZSH_THEME="powerlevel10k/powerlevel10k"

       

        二、#配置Brew(后面可能用得到,已经安装的可不看)

运行下面自动脚本(已经全部替换为国内地址):

(Mac)常规安装脚本(推荐完全体几分钟安装完成)

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

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

(Mac)精简版几秒钟安装完成

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

(Mac)卸载脚本

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

(Linux)安装脚本:

rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh

(Linux)卸载脚本:

rm HomebrewUninstall.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh ; bash HomebrewUninstall.sh

安装问题

如果发现有各种安装不上的运行:

sudo rm -rf /usr/local/Homebrew

提示系统太旧的 (Failed to install Homebrew Portable Ruby (and your system version is too old)!) 运行:

HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles-portable-ruby

rm -rf /Users/$(whoami)/Library/Caches/Homebrew/

brew update

 配置环境变量        

vim ~/.bash_profile
在最后一行添加
export PATH=$PATH:/opt/homebrew/bin;
保存退出执行
source ~/.bash_profile

        

        三、安装插件

 1、安装插件-高亮插件highlighting

cd ~/.oh-my-zsh/custom/plugins/
 
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vi ~/.zshrc

这时我们再次打开zshrc文件进行编辑。找到plugins,此时plugins中应该已经有了git,我们需要把高亮插件也加上:

请务必保证插件顺序,zsh-syntax-highlighting必须在最后一个。

然后在文件的最后一行添加:

	
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

 执行:

source ~/.zshrc

2、安装插件-命令补全zsh-autosuggestion,用于命令建议和补全

cd ~/.oh-my-zsh/custom/plugins/
 
git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc

 找到plugins,加上这个插件即可:

参考文档:

这篇 iTerm2 + Oh My Zsh 教程手把手让你成为这条街最靓的仔

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值