国内安装ohmyzsh_最完整的item2搭配Oh My Zsh文档

点击上方“程序猿小哈”,选择“置顶公众号”

有趣有内涵的文章第一时间送达!

开始前我们先来看下成品

3fb44e0b9fbb5ecadd84b3790e5f971e.png

安装Homebrew

官网

下载脚本命令 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

由于网络原因,官网下载会出现403问题.可以使用国内镜像脚本下载.

下载安装脚本: /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/HomebrewUninstall.sh)"

执行脚本,选择对应的镜像安装

308b18a90c8631c5006ca2eeafe658a8.png

安装成功如图所示:

d7b2051071c3454616baf98fe8792ed3.png

item2安装

1. 官网下载安装item2官网地址

2. brew安装 需要提前安装homebrew

$ brew tap caskroom/cask  # 首次安装需执行该条命令$ brew cask install iterm2 # 安装iterm2

安装Oh my zsh

命令安装方法有两种可以使用curl或wget,看自己环境或喜好:

# curl 安装方式sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

或者

# wget 安装方式sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install

雷同于homebrew,会出443问题,所以可以用非常规方式安装:

下载源码git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

再在终端输入:cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

完成Oh my zsh的安装

安装PowerLine

安装powerline需要先安装pip,已经安装的不用再操作

sudo easy_install pip

4b24a6cc9c2877bc87d5185413ef2b4a.png

安装powerline

pip install powerline-status --user

cd9070074442881b38b400c9418eecdd.png

安装PowerFonts

安装字体库需要首先将项目git clone至本地,然后执行源码中的install.sh。

# git clonegit clone https://github.com/powerline/fonts.git --depth=1# cd to foldercd fonts# run install shell./install.sh

在item2配置中设置好字体

bd400e4aed0ee44536cbbc133804bab6.png

安装配色方案

命令:git clone https://github.com/altercation/solarizedcd solarized/iterm2-colors-solarized/ open .

f2bf597f240f38fa6edc7e020d1b6e63.png

双击Solarized Dark.itermcolors和Solarized Light.itermcolors即可安装明暗两种配色

iTerm2 -> Preferences -> Profiles -> Colors -> Color Presets中根据个人喜好选择这两种配色中的一种即可

e4e19c684cca9200d97cf459f66406d4.png

安装主题

下载agnoster主题,执行脚本安装:git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.gitcd oh-my-zsh-agnoster-fcamblor/ ./install

修改item的配置文件.zshrc设置主体为agnoster

vi ~/.zshrc

d45cf00f3f3cc52741d31f04463be9ce.png

执行source ~/.zshrc配置生效

安装插件

插件安装到/.oh-my-zsh/custom/plugins路径下

cd ~/.oh-my-zsh/custom/plugins/

//高亮插件 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

//代码自动补全插件

git clone https://github.com/zsh-users/zsh-autosuggestions

//编辑配置文件

vi ~/.zshrc

填写需要的插件名称

plugins=(

git

zsh-autosuggestions

zsh-syntax-highlighting

)

注意zsh-syntax-highlighting必须填在最后

af32531a8c83e0055d4fb163c6d58a17.png

填写插件导入路径

source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

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

f194617198eb423fbdea22f4b9b5ff15.png

自动补全插件的颜色是黑色会和底色差不多,所以我们修改一下配色

25cb4fb6081286250eeed4023f691ff3.png

最后我们设置一下背景图片

fdd18947934ee8254f1212069699bd39.png

这样就完成了我们的item2配置

448899aa66aee8c071f9505a076ae14c.png

关注订阅号程序猿小哈,联系作者,加入学习交流群和小伙伴们一起学习进步

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值