From a979c9bf527d393a4b1fe56c02100c42b6e87c95 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 30 Jun 2013 22:27:17 +0200 Subject: [PATCH] add note about bufferline integration --- README.md | 1 + plugin/airline.vim | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f88cce0..7af72ec 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ there's already [powerline](https://github.com/Lokaltog/powerline), why yet anot * it's standard vimscript, no python needed * it's small. i want the entire plugin to be less than 200 lines as a rule * gets you 90% of the way there: in addition to all the standard goodies, supports [fugitve](https://github.com/tpope/vim-fugitive) and [syntastic](https://github.com/scrooloose/syntastic) +* integration with [vim-bufferline](https://github.com/bling/vim-bufferline) * it's fast. since it's so small, it only takes 0.6ms to load. by requiring python, powerline needs 60ms on the same machine. # why's it called airline? diff --git a/plugin/airline.vim b/plugin/airline.vim index dcedf0c..3d9e31e 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -14,18 +14,6 @@ endif set laststatus=2 -function! s:highlight(colors) - let cmd = printf('hi %s %s %s %s %s %s %s', - \ a:colors[0], - \ a:colors[1] != '' ? 'guifg='.a:colors[1] : '', - \ a:colors[2] != '' ? 'guibg='.a:colors[2] : '', - \ a:colors[3] != '' ? 'ctermfg='.a:colors[3] : '', - \ a:colors[4] != '' ? 'ctermbg='.a:colors[4] : '', - \ a:colors[5] != '' ? 'gui='.a:colors[5] : '', - \ a:colors[5] != '' ? 'term='.a:colors[5] : '') - exec cmd -endfunction - let g:airline_colors = { \ 'mode': [ 'User2' , '#00005f' , '#dfff00' , 17 , 190 , 'bold' ] , \ 'mode_seperator': [ 'User3' , '#dfff00' , '#444444' , 190 , 238 , 'bold' ] , @@ -53,6 +41,18 @@ let g:airline_colors_visual = { \ 'statusline': [ 'StatusLine' , '#ffffff' , '#5f0000' , 15 , 52 , '' ] , \ } +function! s:highlight(colors) + let cmd = printf('hi %s %s %s %s %s %s %s', + \ a:colors[0], + \ a:colors[1] != '' ? 'guifg='.a:colors[1] : '', + \ a:colors[2] != '' ? 'guibg='.a:colors[2] : '', + \ a:colors[3] != '' ? 'ctermfg='.a:colors[3] : '', + \ a:colors[4] != '' ? 'ctermbg='.a:colors[4] : '', + \ a:colors[5] != '' ? 'gui='.a:colors[5] : '', + \ a:colors[5] != '' ? 'term='.a:colors[5] : '') + exec cmd +endfunction + function! AirlineModePrefix() let l:mode = mode() @@ -65,7 +65,7 @@ function! AirlineModePrefix() call highlight(g:airline_colors.info_seperator) call highlight(g:airline_colors.file) - if l:mode ==# "i" || l:mode ==# 'R' + if l:mode ==# "i" || l:mode ==# "R" call highlight(g:airline_colors_insert.statusline) call highlight(g:airline_colors_insert.mode) call highlight(g:airline_colors_insert.mode_seperator)