MacOS:iTerm2+oh-my-zsh安装

本文介绍如何安装和配置iTerm2与oh-my-zsh,包括使用SolarizedDark主题、设置robbyrussell作为默认主题,并安装语法高亮插件zsh-syntax-highlighting来提升命令行体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

iTerm2+ohmyzsh安装

先看效果图:
用的主题

  • 1.iterm2>Preferences>Profiles>Colors>Color Presets>Solarized Dark
  • 2.oh-my-zsh默认 主题: ZSH_THEME=“robbyrussell”
    oh-my-zsh

一、安装iterm2

直接网上下载双击安装即可

二、安装oh my zsh

oh-my-zsh

1.curl安装

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

2.wget安装

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

3.配置文件

配置文件位置:~/.zshrc,可根据自己的需求自定义配置, 如主题(ZSH_THEME)、插件(plugins)等

三、oh-my-zsh插件安装

1.语法高亮插件:zsh-syntax-highlighting

  • 进入插件目录、下载
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
  • 修改.zshrc配置文件
vim ~/.zshrc

# plugins中添加高亮插件
plugins=(
    git
    zsh-syntax-highlighting
)

# 在文件最后一行再加上

source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  • 配置生效
source ~/.zshrc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值