是什么 ? | : | Lean & mean status/tabline for vim that's light as air. |
开发语言 | : | VimL |
源码仓库 | : | https://github.com/vim-airline/vim-airline |
step1、在~/.vimrc
中的call plug#begin()
和call plug#end()
之间的行中加入如下配置
Plug 'vim-airline/vim-airline'
w
source %
PlugInstall
help 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.linenr
和let g:airline_symbols.maxlinenr
这两个变量定义的符号, 并不是普通的UTF
编码的字符,要显示出这两个符号来,你需要安装powerline-fonts中的字体,然后让你的Terminal使用名称带有for powerline
的那些字体即可正常显示。
let g:airline#extensions#branch#enabled = 1
表示开启git
分支的展示, 这个利用的是vim-fugitive,你也需要安装这个插件。