最终效果预览
操作步骤
1. 下载插件管理器 ~/.vim/autoload/plug.vim
2. 创建插件保存目录 ~/.vim/plugged/
3. 配置 VIM ~/.vimrc
set laststatus=2 " 永远显示状态栏 let g:airline#extensions#tabline#enabled = 1 " 显示窗口tab和buffer let g:airline#extensions#tabline#alt_sep = 1 let g:airline#extensions#tabline#left_sep = '' let g:airline#extensions#tabline#left_alt_sep = '' let g:airline#extensions#tabline#right_sep = '' let g:airline#extensions#tabline#right_alt_sep = '' let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#tab_nr_type = 2 let g:airline#extensions#tabline#buffers_label = 'Buffers' let g:airline#extensions#tabline#tabs_label = 'Tabs' let g:airline#extensions#tabline#overflow_marker = '…' call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline' " 状态栏美化 Plug 'vim-airline/vim-airline-themes' " 状态栏美化 Plug 'airblade/vim-gitgutter' " 状态栏 git 信息 Plug 'mhinz/vim-signify' " 在行号旁边显示 git 信息 Plug 'sheerun/vim-polyglot' " 多种语言的语法高亮支持 call plug#end()
4. 安装插件
打开 vim,用 :PlugInstall 安装插件
:PlugUpgrade # 升级插件管理器 :PlugUpdate # 更新插件 :PlugSstatus # 检查状态 :PlugClean # 删除插件(需要先去除 .vimrc 中相应的项)