Mac下OH MY ZSH的安装及配置

Mac下OH MY ZSH的安装及配置_第1张图片

1.下载oh my zsh:

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

2.下载iTerm2:

https://www.iterm2.com

3.安装powerline字体:

# clone

git clone https://github.com/powerline/fonts.git --depth=1

# install

cd fonts

./install.sh

# clean-up a bit

cd ..

rm -rf fonts

在iterm2里面修改字体和背景色:



4.改bas为zsh:

chsh -s /bin/zsh

5.安装插件:

a.zsh-autosuggestions:

Mac下OH MY ZSH的安装及配置_第2张图片

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

b.zsh-syntax-highlighting:

Mac下OH MY ZSH的安装及配置_第3张图片

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

c.powerlevel9k

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

修改.zshrc:

ZSH_THEME="powerlevel9k/powerlevel9k"


Mac下OH MY ZSH的安装及配置_第4张图片

6.修改.zshrc文件:



Mac下OH MY ZSH的安装及配置_第5张图片

7.source ~/.zshrc


Mac下OH MY ZSH的安装及配置_第6张图片

8.powerlevel9k主题的设置:


Mac下OH MY ZSH的安装及配置_第7张图片

上面的字体选择有三种:

1.nerdfont-complete

2.awesome-fontconfig

3.awesome-patched


Mac下OH MY ZSH的安装及配置_第8张图片

# 左侧栏目显示的要素(指定的关键字参考官网) POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs)

#添加连接上下连接箭头更方便查看

POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="↱"

POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ "

#新起一行显示命令 (推荐!极其方便)

POWERLEVEL9K_PROMPT_ON_NEWLINE=true

#右侧状态栏与命令在同一行

POWERLEVEL9K_RPROMPT_ON_NEWLINE=true

#字体设定 (注意,字体设定必须放在主题之前)

POWERLEVEL9K_MODE='nerdfont-complete'

你可能感兴趣的:(Mac下OH MY ZSH的安装及配置)