Code-iTerm2配置
zsh
zsh
Mac
自带的
zsh
终端
cat /etc/shells
修改系统默认的终端为
zsh
# 更改终端
chsh -s /bin/zsh
# 确认是否更改成功
echo $SHELL
# /bin/zsh
安装
oh-my-zsh
oh-my-zsh
::: tip
链接
https://github.com/robbyrussell/oh-my-zsh
:::
安装
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安装主题和字体
::: tip
链接
https://github.com/Powerlevel9k/powerlevel9k
:::
因为安装了
oh-my-zsh
,就用下面的方式安装即可
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
编辑
.zshc
.zshc
vi .zshrc
# 更改
ZSH_THEME="powerlevel9k/powerlevel9k"
下载字体
直接找到字体文件下载下来 安装
::: tip
https://github.com/gabrielelana/awesome-terminal-fonts
:::
安装好即可
更改字体
这时候打开终端字体是乱码的 需要配置一下字体
下载主题
::: tip
https://iterm2colorschemes.com/
https://github.com/mbadolato/iTerm2-Color-Schemes
:::
主题设置,字体设置
安装
iTerm2
iTerm2
::: tip
链接
https://www.iterm2.com/downloads.html
:::
主题设置,字体配置
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dsbAkRP9-1578473264552)(https://raw.githubusercontent.com/xiaoping027/imgroom/master/20190926211450.png)]
更改
.zshc
设置
.zshc
::: tip
https://github.com/Powerlevel9k/powerlevel9k/wiki/Show-Off-Your-Config
:::
进一步配置参考
VSCode
配置
VSCode
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "zsh",
"terminal.integrated.fontFamily": "Droid Sans Mono Awesome",
注意
iTerm
图标无法显示问题
这边字体配置要放在主题前面
# 字体设置房放在主题设置前面
POWERLEVEL9K_MODE='awesome-patched'
ZSH_THEME="powerlevel9k/powerlevel9k"
我的配置
POWERLEVEL9K_MODE='awesome-patched'
ZSH_THEME="powerlevel9k/powerlevel9k"
plugins=(
git
extract
z
)
source $ZSH/oh-my-zsh.sh
source ~/.bash_profile
POWERLEVEL9K_HOME_ICON=''
POWERLEVEL9K_HOME_SUB_ICON=''
POWERLEVEL9K_FOLDER_ICON=''
DISABLE_AUTO_TITLE="true"
POWERLEVEL9K_VCS_GIT_ICON=''
POWERLEVEL9K_VCS_STAGED_ICON='\u00b1'
POWERLEVEL9K_VCS_UNTRACKED_ICON='\u25CF'
POWERLEVEL9K_VCS_UNSTAGED_ICON='\u00b1'
POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='\u2193'
POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='\u2191'
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='green'
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
#POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status os_icon context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(background_jobs virtualenv rbenv rvm time)
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=4
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M \uE868 %d.%m.%y}"
POWERLEVEL9K_STATUS_VERBOSE=false
export DEFAULT_USER="$USER"