Skip to content

2020年item2美化

date: 2020-05-21

修改默认终端

bash
# 设置zsh为你的默认的shell
$ chsh -s /bin/zsh

安装Oh my zsh

配置了代理

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

或者

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

未配置代理的

bash
# 克隆这个项目
$ git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# 创建zsh的配置文件
$ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

然后重启

安装PowerLine

bash
$ pip install powerline-status --user

没安装pip的同学需要先安装,然后再执行安装PowerLine

bash
$ sudo easy_install pip

安装PowerFonts

需要先将项目clone 到本地, 如:~/Desktop/OpenSource/

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

装好字体库之后,我们来设置iTerm2的字体,具体的操作是iTerm2 -> Preferences -> Profiles -> Text,在Font区域选中Change Font,然后找到Meslo LG字体。有L、M、S可选,看个人喜好

安装配色方案

同样使用git clone的方式下载源码进行安装

bash
cd ~/Desktop/OpenSource
git clone https://github.com/altercation/solarized
cd solarized/iterm2-colors-solarized/
open .

在打开的finder窗口中,双击Solarized Dark.itermcolors和Solarized Light.itermcolors即可安装明暗两种配色. 再次进入iTerm2 -> Preferences -> Profiles -> Colors -> Color Presets中根据个人喜好选择这两种配色中的一种即可.

安装主题

同样使用git clone的方式下载源码进行安装

bash
cd ~/Desktop/OpenSource
git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git
cd oh-my-zsh-agnoster-fcamblor/
./instal

执行上面的命令会将主题拷贝到oh my zsh的themes中.

拷贝完成后,执行命令打开zshrc配置文件,将ZSH_THEME后面的字段改为agnoster。

bash
vi ~/.zshrc

配置完,cmd + q 退出再进入。

安装高亮插件

同样使用git clone的方式下载源码进行安装

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

打开zshrc文件进行编辑。找到plugins,此时plugins中应该已经有了git,我们需要把高亮插件也加上,必须是最后一个

bash
$ vi ~/.zshrc
# plugins改成
plugins = (
  git
  zsh-syntax-highlighting
)
# 文件最后一行添加
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# 保存后执行
$ source ~/.zshrc

可选择、命令补全

同样使用git clone的方式下载源码进行安装

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

然后打开zshrc文件进行编辑。找到plugins,加上这个插件

bash
$ vi ~/.zshrc
# plugins改成
plugins = (
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

vsocde 字体设置

bash
$ cd ~/.oh-my-zsh/custom/plugins/
$ git clone https://github.com/abertsch/Menlo-for-Powerline.git

然后将字体安装到系统字体库里 设置vscode中终端的字体为 Menlo for Powerline

京ICP备2024093538号-1