关于mac下的zsh主题powerline配置
zsh的powerline配置
首先需要安装pip
easy_install pip
然后如果系统是10.11以上,需要关闭安全服务
1、重启电脑,按command+R进入恢复模式,点击菜单【实用工具】,打开【终端】,输入 csrutil disable
2、重启电脑,正常进入,打开【终端】输入 csrutil status 查看是否关闭
然后通过pip安装powerline
pip install powerline-status
安装完成后通过pip show powerline-status查看powerline所处的具体路径
在zsh配置文件中添加执行脚本
vim ~/.zshrc . /Library/Python/2.7/site-packages/powerline/bindings/bash/powerline.sh
安装powerline字体
git clone https://github.com/powerline/fonts.git cd fonts ./install.sh
修改终端字体为带powerline的补丁字体
VIM相关配置
这部分我们将介绍如何为VIM配置powerline。
首先你需要确保你的vim编译时开启了python支持。
如果通过python –version|grep +python没有结果的话,那么你需要通过brew install vim –with-python –with-ruby –with-perl重新编译安装vim,或者使用brew install macvim –env-std –override-system-vim安装macvim。
然后,你只需要在~/.vimrc中加上以下部分,VIM就能够正常加载power line功能了。
注意:其中set rtp+=/Library/Python/2.7/site-packages/powerline/bindings/vim和上文一样需要按照自己的实际情况调整。
set rtp+=/Library/Python/2.7/site-packages/powerline/bindings/vim
" These lines setup the environment to show graphics and colors correctly.
set nocompatible
set t_Co=256
let g:minBufExplForceSyntaxEnable = 1
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
set laststatus=2 " Always display the statusline in all windows
set guifont=Inconsolata\ for\ Powerline:h14
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)