天天看点

最完整的item2搭配Oh My Zsh文档

作者:程序猿小哈

#头条创作挑战赛#

开始前我们先来看下成品

最完整的item2搭配Oh My Zsh文档

安装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)"

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

最完整的item2搭配Oh My Zsh文档

安装成功如图所示:

最完整的item2搭配Oh My Zsh文档

item2安装

1. 官网下载安装

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

安装powerline

pip install powerline-status --user

最完整的item2搭配Oh My Zsh文档

安装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配置中设置好字体

最完整的item2搭配Oh My Zsh文档

安装配色方案

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

最完整的item2搭配Oh My Zsh文档

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

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

最完整的item2搭配Oh My Zsh文档

安装主题

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

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

vi ~/.zshrc

最完整的item2搭配Oh My Zsh文档

执行source ~/.zshrc配置生效

安装插件

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

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

//高亮插件 git clone

//代码自动补全插件

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

//编辑配置文件

vi ~/.zshrc

填写需要的插件名称

plugins=(

git

zsh-autosuggestions

zsh-syntax-highlighting

)

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

最完整的item2搭配Oh My Zsh文档

填写插件导入路径

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

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

最完整的item2搭配Oh My Zsh文档

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

最完整的item2搭配Oh My Zsh文档

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

最完整的item2搭配Oh My Zsh文档

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

继续阅读