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

倾然丶 夕夏残阳落幕 提交于 2020-08-13 17:10:10
开始前我们先来看下成品
 
安装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安装
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
安装powerline
pip install powerline-status --user
 
安装PowerFonts
安装字体库需要首先将项目git clone至本地,然后执行源码中的install.sh。
# git clone git clone https://github.com/powerline/fonts.git --depth= 1 # cd to folder cd fonts # run install shell ./install.sh
在item2配置中设置好字体
安装配色方案
命令: git clone https://github.com/altercation/solarized cd solarized/iterm2-colors-solarized/ open .
双击Solarized Dark.itermcolors和Solarized Light.itermcolors即可安装明暗两种配色
iTerm2 -> Preferences -> Profiles -> Colors -> Color Presets中根据个人喜好选择这两种配色中的一种即可
安装主题
下载agnoster主题,执行脚本安装: git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git cd oh-my-zsh-agnoster-fcamblor/ ./install
修改item的配置文件 .zshrc 设置主体为 agnoster
vi ~/.zshrc
执行 source ~/.zshrc配置生效
安装插件
插件安装到/.oh-my-zsh/custom/plugins路径下
cd ~/.oh-my-zsh/custom/plugins/
//代码自动补全插件
git clone https://github.com/zsh-users/zsh-autosuggestions
//编辑配置文件
vi ~/.zshrc
填写需要的插件名称
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
注意zsh-syntax-highlighting必须填在最后
填写插件导入路径
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配置

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

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!