其他分享
首页 > 其他分享> > Vim airline状态栏设置

Vim airline状态栏设置

作者:互联网

 

最终效果图

 

 

乱码要安装 Consolas-with-Yahei

call plug#begin('F:\Program Files\gvim\vim\plug')
"===状态栏===
Plug 'vim-airline/vim-airline' " 状态栏
Plug 'vim-airline/vim-airline-themes' " 状态栏主题

"===配色方案===
Plug 'lifepillar/vim-solarized8' " solarized8主题
Plug 'ayu-theme/ayu-vim' " ayu主题
Plug 'nathanaelkane/vim-indent-guides' " 显示缩进级别

"===目录树===
Plug 'scrooloose/nerdtree' " 目录树,方便浏览当前目录下的文件
Plug 'Xuyuanp/nerdtree-git-plugin' " 目录树git提示
Plug 'kien/ctrlp.vim' " 适用于大规模项目文件的浏览

"===自动化===
Plug 'neoclide/coc.nvim', {'branch': 'release'} " 代码补全 需要vim >=8 或neovim
Plug 'vim-syntastic/syntastic' " 错误语法提示
Plug 'jiangmiao/auto-pairs' " 符号补全

"===历史===
Plug 'mbbill/undotree' " 历史修改撤回
Plug 'tpope/vim-fugitive' "git
"===文本===
Plug 'godlygeek/tabular' " 文本过滤、对齐工具
Plug 'gcmt/wildfire.vim' " 视图模式下快速选中符号中的内容
Plug 'scrooloose/nerdcommenter' " 快速注释一行
"===其他===
Plug 'yianwillis/vimcdoc' " vim中文帮助
"Plug 'liuchengxu/vim-which-key' " 显示被绑定的可用按键
"==依赖==
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'kana/vim-textobj-user'
Plug 'fadein/vim-FIGlet'
call plug#end()


" Vim 在与屏幕/键盘交互时使用的编码(取决于实际的终端的设定)
set encoding=utf-8
set langmenu=zh_CN.UTF-8
" 设置打开文件的编码格式
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set fileencoding=utf-8
" 解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" 解决consle输出乱码
"set termencoding = cp936
" 设置中文提示
language messages zh_CN.utf-8
" 设置中文帮助
set helplang=cn
" 设置为双字宽显示,否则无法完整显示如:☆
set ambiwidth=double

 


"字体设置
set guifont=Consolas-with-Yahei:h14:cANSI
"airline插件设置
let g:airline_theme="powerlineish"
let g:airline_theme="dark" " 设置主题
" 总是显示状态栏
let laststatus = 2
" 支持 powerline 字体
let g:airline_powerline_fonts = 1
"显示窗口tab和buffer
let g:airline#extensions#tabline#left_sep = ' ' "tabline中未激活buffer两端的分隔字符
let g:airline#extensions#tabline#enabled = 1
" 关闭空白符检测
let g:airline#extensions#whitespace#enabled=0
" tabline中buffer显示编号
let g:airline#extensions#tabline#left_alt_sep = '|' "tabline中buffer显示编号
let g:airline#extensions#tabline#buffer_nr_show = 1

if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif

" powerline symbols


" 状态栏分隔美化 需要安装powerline-fonts字体(https://github.com/powerline/fonts) #sudo pacman -S powerline-fonts
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.dirty= '⚡'


"buffer列表中下一个
noremap <C-tab> :bn<CR>
"buffer列表中上一个
nnoremap <C-s-tab> :bp<CR>
"你之前所在的前一个 buffer
nnoremap <C-#> :b#<CR>
"新建tab
nnoremap <C-n> :tabnew<cr>
"按Ctrl+^ 关闭当前buffer
nnoremap <C-^> :bd<CR>
"关闭buffer
"nnoremap <C-w> :bd<cr>

标签:Plug,set,状态栏,vim,symbols,let,airline,Vim
来源: https://www.cnblogs.com/athrunwu/p/14772632.html