linux安装powerline字体,CentOS 7.3安装配置Powerline

一、Powerline简介及演示环境:

Powerline是一个极棒的Vim编辑器的状态栏插件,主要用于显示状态行和提示信息。

特点:使用Python编写,使其更具扩展性且功能丰富

稳定易测的代码库,兼容Python 2.6+和Python 3

支持多种Linux功能及工具的提示和状态栏

通过JSON保存配置和颜色方案

快速、轻量级,具有后台守护进程支持,提供更佳的性能

GitHub:https://github.com/powerline/powerline

Docs:https://powerline.readthedocs.io/en/latest/

演示环境:

系统:CentOS Linux release 7.3.1611 (Core)

Python版本:系统自带的2.7.5

Bash版本:系统自带的4.2.46(1)-release(x86_64-redhat-linux-gnu)

备注:在CentOS 6.9环境中,自带Bash版本为4.1.2,Python版本无论为2.6.6、2.7.x还是3.6.x都会出现如下错误提示

13f840e26d70b3f5d943f8477e11a6d7.png

二、安装依赖软件包:

# yum -y install epel-release git python-pip wget

# pip -V  -->  pip 8.1.2 from/usr/lib/python2.7/site-packages (python 2.7)

三、安装Powerline:

# pip install git+git://github.com/powerline/powerline

606c3ba5bed73d04a993b91ab3fd8ef0.png

四、安装Powerline字体:

#wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf

# wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf

# mv PowerlineSymbols.otf /usr/share/fonts/

# fc-cache -vf /usr/share/fonts/            //更新系统的字体缓存

# mv 10-powerline-symbols.conf /etc/fonts/conf.d/

五、在Bash中启用Powerline:

# pip show powerline-status     //获取Powerline的安装位置

07e3f03e3f275ffcf5238e496ae41579.png

# find / -name powerline.sh -->  /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh

# vim /etc/profile.d/powerline.sh

powerline-daemon -q

POWERLINE_BASH_CONTINUATION=1

POWERLINE_BASH_SELECT=1

. /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh

# . /etc/profile.d/powerline.sh

5028908838332621e4c755855a7916ff.png

六、在Vim中启用Powerline:

# find / -name vim --> /usr/lib/python2.7/site-packages/powerline/bindings/vim

新建文件/root/.vimrc,添加如下代码至文件/root/.vimrc

# vim /root/.vimrc

set rtp+=/usr/lib/python2.7/site-packages/powerline/bindings/vim

set laststatus=2

set t_Co=256

# . /root/.vimrc

849bfe56cf952de20399e28744815245.png

8110e8c1ff25de8c49fd13edf30cfa15.png

54ea2c994b513b197909c4970118b302.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值