作者 :Otway
版权 :转载请注明出处!
安装
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# Backup your existing ~/.zshrc file: optional
cp ~/.zshrc ~/.zshrc.orig
# Recommend
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
source ~/.zshrc
# Change your default shell
chsh -s /bin/zsh
主题配置
采用的是powerlevel9k主题,色系是Neutron
以下是安装 powerline 以及解决字体乱码问题
pip install --user powerline-status
# Download fonts and font config.
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
# Linux
mv PowerlineSymbols.otf ~/.fonts/
# Update font cache for the path the font was moved to.
fc-cache -vf ~/.fonts/
# Install the fontconfig file.
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
# Mac OS X
# You can click the PowerlineSymbols.otf to install or you can move the file to font dir like:
mv PowerlineSymbols.otf /Library/Fonts/
字体安装完毕之后,需要:
配置色系
- Launch iTerm 2. Get the latest version at iterm2.com
- Type CMD+i (⌘+i)
- Navigate to Colors tab
- Click on Load Presets
- Click on Import
- Save the neutron.itermcolors file
- Click on Load Presets and choose neutron
配置字体
- Navigate to Text tab
- Click Change Font
- Search PowerlineSymbols and select to use
样式配置(在~/.zshrc中添加):
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time)
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S}"
POWERLEVEL9K_NODE_VERSION_BACKGROUND='022'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
网友评论