MacOS下iterm,Dracula主题配置

在这里插入图片描述

前提:已安装Git和Anaconda环境

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  • 安装wget:
brew install wget

1 安装iterm2

前往iterm2官网下载安装

2 安装oh-my-zsh

GitHub仓库地址:https://github.com/ohmyzsh/ohmyzsh
安装方法如下(貌似需要科学~~skr~~上网):

# curl下载
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# wget下载
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# fetch下载
sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

配置文件的备份与创建

# 备份原配置文件
cp ~/.zshrc ~/.zshrc_bp
# 创建新的配置文件
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Note: 如果在这之前安装了Anaconda,可能需要将原配置文件中的环境变量设置拷贝到新的配置文件中。

3 安装PowerLine

pip install powerline-status

Note:此处我已经安装过Anaconda

4 安装PowerFonts

GitHub仓库:https://github.com/powerline/fonts
好像很多主题必须得改用Meslo字体,否则会导致显示乱码。

# 新建文件夹,用来存储相关资源
mkdir -p ~/The/Path/U/Like
cd ~/The/Path/U/Like
# 下载源码
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
# 安装字体
./install.sh

安装好字体之后,进入iterm2的Preferences中进行设置
在这里插入图片描述

5 安装Dracula主题

5.1 Dracula for ZSH

GitHub仓库地址:https://github.com/dracula/zsh

# 新建文件夹,用来存储Dracula相关资源
mkdir -p ~/The/Path/U/Like/Dracula
cd ~/The/Path/U/Like/Dracula
# 下载主题资源
git clone https://github.com/dracula/zsh.git
# 复制文件
cp ./zsh/dracula.zsh-theme ~/.oh-my-zsh/themes/
# 参考GitHub仓库issue#11,https://github.com/dracula/zsh/issues/11
cd ./zsh/
cp -r ./lib/ ~/.oh-my-zsh/themes/

安装完成之后,需要修改~/.zshrc文件,参见https://draculatheme.com/zsh,如下:
在这里插入图片描述

修改之后,激活~/.zshrc文件

source ~/.zshrc

5.2 Dracula for iterm2

GitHub仓库地址:https://github.com/dracula/iterm

cd ~/The/Path/U/Like/Dracula
# 下载主题资源
git clone https://github.com/dracula/iterm.git

设置主题,参见https://draculatheme.com/iterm
在这里插入图片描述

设置完成之后,如下:
在这里插入图片描述

5.3 Dracula for vim

GitHub仓库:https://github.com/dracula/vim
安装参见https://draculatheme.com/vim

mkdir -p ~/.vim/pack/themes/start
cd ~/.vim/pack/themes/start
git clone https://github.com/dracula/vim dracula
vi ~/.vimrc

在这里插入图片描述

6 安装高亮和命令补全插件

高亮插件,GitHub仓库地址:https://github.com/zsh-users/zsh-syntax-highlighting
命令补全插件,GitHub仓库地址:https://github.com/zsh-users/zsh-autosuggestions

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions
# 修改~/.zshrc文件
vi ~/.zshrc
# 修改之后激活环境
source ~/.zshrc

修改内容如下:

plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)

# 并在文件末尾添加
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

参考博客:

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值