mac的iterm2的小清新主题

本文详述如何安装必备工具,配置zsh环境,包括oh-my-zsh、powerlevel9k、zsh-autosuggestions和zsh-syntax-highlighting。一步步教你导入Material Design颜色方案,自定义字体和提示样式,适用于终端新手和高级用户。

准备工作:

1,安装iterm2和git

2,安装ohmysh

#!/bin/sh

sudo apt-get install git zsh

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

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

sed -i -- 's/ZSH_THEME="robbyrussell"/POWERLEVEL9K_CUSTOM_LIVE="echo -n \\"\\uf525 LIVE \\uf525\\""\nPOWERLEVEL9K_CUSTOM_LIVE_BACKGROUND="red"\nPOWERLEVEL9K_CUSTOM_LIVE_FOREGROUND="white"\nPOWERLEVEL9K_MODE="nerdfont-complete"\nPOWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_live host dir vcs)\nPOWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs load ram disk_usage time)\nZSH_THEME="powerlevel9k\/powerlevel9k"\nDEFAULT_USER=roamsys\n/g' ~/.zshrc

git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

sed -i -- 's/^plugins=(/plugins=(\n  zsh-autosuggestions\n  zsh-syntax-highlighting\n/g' ~/.zshrc

3,下载配置文件

git clone https://github.com/chongqiangchen/iterm-config.git ${ZSH_CUSTOM:-~}

4,下载 awesome-terminal-fonts

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

第一步:

1、打开准备工作中的第二步下载的文件夹

2、打开Iterm2 -> Preference -> Profiles -> Color -> Color Presets -> import

导入material-design-colors.itermcolors文件,并选择

注意,这边还需要一点改变: Color中一栏选择为ANSI Colors的black颜色改为4b585e,后面配置需要这个颜色。

3、安装iterm-config文件夹中的.ttf两个字体

4、打开Iterm2 -> Preference -> Profiles -> Text 按照图中的设置

注意,如果需要透明度或者背景可以在Iterm2 -> Preference -> Profiles -> Window中进行调节设置

第二步:

1、进入zshrc

cd
vi .zshrc

2、配置zshrc

确认一下配置是否存在,不存在或不一样请加入这些或更改:

source ~/awesome-terminal-fonts/build/*.sh
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

POWERLEVEL9K_MODE='nerdfont-complete'

ZSH_THEME="powerlevel9k/powerlevel9k"

source $ZSH/oh-my-zsh.sh

引入powerlevel9k的设置:

POWERLEVEL9K_OS_ICON_BACKGROUND='black'

POWERLEVEL9K_CONTEXT_TEMPLATE='%n'
POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND='black'
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND='white'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='\u256D\u2500'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{014}\u2570%F{cyan}>%F{073}>%F{101}>%f "
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_ICON='?'

POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time ip background_jobs)

POWERLEVEL9K_SHORTEN_DIR_LENGTH=2

POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"
POWERLEVEL9K_TIME_BACKGROUND='white'
POWERLEVEL9K_HOME_ICON=''
POWERLEVEL9K_HOME_SUB_ICON=''
POWERLEVEL9K_FOLDER_ICON=''
POWERLEVEL9K_STATUS_VERBOSE=true
POWERLEVEL9K_STATUS_CROSS=true

3、结束,重新开启终端便可以看到新的界面。

 

注以上配置大部分来自于https://zhuanlan.zhihu.com/p/75798519;由于其配置对于小白来讲还不够详细,再次我做优化教程调整,并以发布,

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值