first class integration with tagbar

This commit is contained in:
Bailey Ling 2013-07-31 20:07:14 +00:00
parent 6df46d8d22
commit 577e50d788
3 changed files with 22 additions and 14 deletions

View File

@ -71,9 +71,9 @@ endfunction
function! airline#update_externals() function! airline#update_externals()
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('*bufferline#get_status_string') let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('*bufferline#get_status_string')
\ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string() \ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string() : "%f%m"
\ : "%f%m" let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag')
let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') ? '%{SyntasticStatuslineFlag()}' : '' \ ? '%{SyntasticStatuslineFlag()}' : ''
let g:airline_externals_branch = g:airline_enable_branch let g:airline_externals_branch = g:airline_enable_branch
\ ? (exists('*fugitive#head') && strlen(fugitive#head()) > 0 \ ? (exists('*fugitive#head') && strlen(fugitive#head()) > 0
\ ? g:airline_branch_prefix.fugitive#head() \ ? g:airline_branch_prefix.fugitive#head()
@ -81,6 +81,8 @@ function! airline#update_externals()
\ ? g:airline_branch_prefix.lawrencium#statusline() \ ? g:airline_branch_prefix.lawrencium#statusline()
\ : '') \ : '')
\ : '' \ : ''
let g:airline_externals_tagbar = g:airline_enable_tagbar && exists(':Tagbar')
\ ? '%(%{tagbar#currenttag("%s","")} '.g:airline_right_alt_sep.'%)' : ''
endfunction endfunction
function! s:getwinvar(winnr, key, ...) function! s:getwinvar(winnr, key, ...)
@ -120,7 +122,8 @@ function! s:get_statusline(winnr, active)
let sl.=l:status_color.' %f%m' let sl.=l:status_color.' %f%m'
endif endif
if !s:getwinvar(a:winnr, 'airline_left_only', 0) if !s:getwinvar(a:winnr, 'airline_left_only', 0)
let sl.='%= '.s:get_section(a:winnr, 'x').' ' let sl.='%='.g:airline_externals_tagbar
let sl.=' '.s:get_section(a:winnr, 'x').' '
let sl.=l:info_sep_color let sl.=l:info_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
let sl.=l:info_color let sl.=l:info_color

View File

@ -6,24 +6,23 @@ INTRODUCTION *airline*
There's already powerline <https://github.com/Lokaltog/powerline>, why yet There's already powerline <https://github.com/Lokaltog/powerline>, why yet
another statusline? another statusline?
* it's 100% vimscript; no python needed. * 100% vimscript; no python needed.
* it's small. i want the core plugin to be less than 200 lines as a rule. * small. i want the core plugin to be less than 200 lines as a rule.
* it gets you 90% of the way there; in addition to all the standard goodies, * integrates with a variety of popular plugins, including:
it integrates with a variety of popular plugins, including:
* fugitve <https://github.com/tpope/vim-fugitive> * fugitve <https://github.com/tpope/vim-fugitive>
* syntastic <https://github.com/scrooloose/syntastic> * syntastic <https://github.com/scrooloose/syntastic>
* vim-bufferline <https://github.com/bling/vim-bufferline> * vim-bufferline <https://github.com/bling/vim-bufferline>
* unite <https://github.com/Shougo/unite.vim> * unite <https://github.com/Shougo/unite.vim>
* ctrlp <https://github.com/kien/ctrlp.vim> * ctrlp <https://github.com/kien/ctrlp.vim>
* lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium> * lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
* it looks good with regular fonts, and provides configuration points so you * looks good with regular fonts, and provides configuration points so you
can use unicode or powerline symbols. can use unicode or powerline symbols.
* it's fast to load, taking roughly 1ms. by comparison, powerline needs * fast to load, taking roughly 1ms. by comparison, powerline needs 60ms
60ms on the same machine. on the same machine.
* it's fully customizable; if you know a little |statusline| syntax you can * fully customizable; if you know a little |statusline| syntax you can
tweak it to your needs. tweak it to your needs.
* it's trivial to write colorschemes; for a minimal theme you need to edit * trivial to write colorschemes; for a minimal theme you need to edit
9 lines of colors. (please send pull requests if you create new themes!) 9 lines of colors. (please send pull requests)
============================================================================== ==============================================================================
NAME *airline-name* NAME *airline-name*
@ -59,6 +58,11 @@ values):
let g:airline_enable_syntastic=1 let g:airline_enable_syntastic=1
< <
* enable/disable tagbar integration
>
let g:airline_enable_tagbar=1
<
* enable modified detection * enable modified detection
> >
let g:airline_detect_modified=1 let g:airline_detect_modified=1

View File

@ -18,6 +18,7 @@ call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_font
call s:check_defined('g:airline_enable_bufferline', 1) call s:check_defined('g:airline_enable_bufferline', 1)
call s:check_defined('g:airline_enable_branch', 1) call s:check_defined('g:airline_enable_branch', 1)
call s:check_defined('g:airline_enable_syntastic', 1) call s:check_defined('g:airline_enable_syntastic', 1)
call s:check_defined('g:airline_enable_tagbar', 1)
call s:check_defined('g:airline_detect_iminsert', 0) call s:check_defined('g:airline_detect_iminsert', 0)
call s:check_defined('g:airline_detect_modified', 1) call s:check_defined('g:airline_detect_modified', 1)
call s:check_defined('g:airline_detect_paste', 1) call s:check_defined('g:airline_detect_paste', 1)