vim-airline
1.1、vim-airline简介
是什么 ?:Lean & mean status/tabline for vim that's light as air.
开发语言:VimL
源码仓库:https://github.com/vim-airline/vim-airline
1.2、通过vim-plug安装vim-airline

step1、在~/.vimrc中的call plug#begin()call plug#end()之间的行中加入如下配置

Plug 'vim-airline/vim-airline'

step2、在Vim底行模式下依次执行如下3个命令

w
source %
PlugInstall
1.3、查看vim-airline帮助文档

Vim底行模式下执行如下命令:

help airline
1.4、vim-airline相关配置

我的配置:

let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
    let g:airline_symbols = {}
endif
let g:airline_symbols.linenr                   = ''
let g:airline_symbols.maxlinenr                = ' '

let w:airline_skip_empty_sections              = 1
let g:airline_section_b                        = '%{fugitive#head()}'
let g:airline_section_c                        = ''
let g:airline_section_x                        = '%{&filetype}'
let g:airline_section_warning                  = ''

let g:airline#extensions#tabline#enabled       = 1
let g:airline#extensions#tabline#fnamemod      = ':~'
let g:airline#extensions#tabline#fnamecollapse = 0

let g:airline#extensions#branch#enabled              = 1
let g:airline#extensions#branch#displayed_head_limit = 10

效果如下:

注意:

let g:airline_symbols.linenrlet g:airline_symbols.maxlinenr这两个变量定义的符号, 并不是普通的UTF编码的字符,要显示出这两个符号来,你需要安装powerline-fonts中的字体,然后让你的Terminal使用名称带有for powerline的那些字体即可正常显示。

let g:airline#extensions#branch#enabled = 1表示开启git分支的展示, 这个利用的是vim-fugitive,你也需要安装这个插件。