配置vim markdown 高亮

安装autoload

yum -y install git  
mkdir ~/.vim/autoload/ -p
cd .vim/autoload/
wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

注意,这里需要先安装git,不然在执行安装的时候会提示pluginstall not an editor command

配置.vimrc

"安装插件
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'majutsushi/tagbar'
call plug#end()
"不显示文档总字数
let g:airline#extensions#wordcount#enabled = 0
"不显示文件编码(Windows系统)
let g:airline#parts#ffenc#skip_expected_string='utf-8[dos]'
"设置tagber对于markdown的支持
let g:tagbar_type_markdown = {
    \ 'ctagstype' : 'markdown',
    \ 'kinds' : [
        \ 'h:Chapter',
        \ 'i:Section',
        \ 'k:Paragraph',
        \ 'j:Subparagraph'
    \ ]
\ }
"取消显示warning部分
let g:airline_section_warning = ''
"取消显示section_b
let g:airline_section_b = ''
"section_c显示为tagbar检索出来的标题
let g:airline_section_c = airline#section#create(['tagbar'])
"section_x显示文件名
let g:airline_section_x = '%{expand("%")}'
"section_y显示时间
let g:airline_section_y = airline#section#create(['%{strftime("%D")}'])
"section_z显示日期
let g:airline_section_z = airline#section#create(['%{strftime("%H:%M")}'])
"激活tagbar扩展
let g:airline#extensions#tagbar#enabled = 1

执行PlugInstall 命令完成安装


donation