vim-airline
1.1、vim-airline简介

vim-airline是一个Vim状态栏美化插件。

vim-airlineGitHub上的网址:https://github.com/vim-airline/vim-airline

1.2、通过Vundle安装vim-airline

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

Plugin 'vim-airline/vim-airline'

2、在Vim底行模式下执行如下命令:

PluginInstall
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,你也需要安装这个插件。