diff --git a/README.md b/README.md index 5da2671..ec85b6a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Lean & mean status/tabline for vim that's light as air. # Features * Tiny core written with extensibility in mind ([open/closed principle][8]). -* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [lawrencium][21] and [virtualenv][31]. +* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21] and [virtualenv][31]. * Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols. * Optimized for speed; it loads in under a millisecond. * Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. @@ -61,6 +61,15 @@ vim-airline integrates with a variety of plugins out of the box. These extensio #### [syntastic][5] ![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png) +#### [eclim][34] + +*eclim* 's syntax checker extension works well with *syntastic* 's extension. + +* By default, it turned on when *eclim* was installed. +* When you installed *eclim* but want to turn off this extension, add next line in your vimrc: + + let g:airline#extensions#eclim#enabled = 0 + #### hunks ([vim-gitgutter][29] & [vim-signify][30]) ![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png) @@ -196,3 +205,4 @@ MIT License. Copyright (c) 2013 Bailey Ling. [31]: https://github.com/jmcantrell/vim-virtualenv [32]: https://github.com/chriskempson/base16-vim [33]: https://github.com/bling/vim-airline/wiki/Test-Plan +[34]: http://eclim.org diff --git a/autoload/airline/deprecation.vim b/autoload/airline/deprecation.vim index a39199c..dd0567f 100644 --- a/autoload/airline/deprecation.vim +++ b/autoload/airline/deprecation.vim @@ -19,6 +19,7 @@ function! airline#deprecation#check() \ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ], \ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ], \ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ], + \ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ], \ ] for test in tests if exists(test[0]) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 814318f..385fcb6 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -181,6 +181,10 @@ function! airline#extensions#load() call airline#extensions#virtualenv#init(s:ext) endif + if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate')) + call airline#extensions#eclim#init(s:ext) + endif + if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1)) \ && exists(':SyntasticCheck') call airline#extensions#syntastic#init(s:ext) diff --git a/autoload/airline/extensions/eclim.vim b/autoload/airline/extensions/eclim.vim new file mode 100644 index 0000000..99b3f4e --- /dev/null +++ b/autoload/airline/extensions/eclim.vim @@ -0,0 +1,23 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !exists(':ProjectCreate') + finish +endif + +function! airline#extensions#eclim#get_warnings() + let eclimList = eclim#display#signs#GetExisting() + if !empty(eclimList) + let errorsLine = eclimList[0]['line'] + let errorsNumber = len(eclimList) + let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]" + if !exists(':SyntasticStatuslineFlag') || SyntasticStatuslineFlag() == '' + return errors.(g:airline_symbols.space) + endif + endif + return '' +endfunction + +function! airline#extensions#eclim#init(ext) + call airline#parts#define_function('eclim', 'airline#extensions#eclim#get_warnings') +endfunction diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index f5276d4..98e662e 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -78,7 +78,7 @@ function! airline#init#bootstrap() call airline#parts#define_raw('file', '%f%m') call airline#parts#define_raw('linenr', (g:airline_symbols.linenr).'%#__accent_bold#%4l%#__restore__#') call airline#parts#define_function('ffenc', 'airline#parts#ffenc') - call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace']) + call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace']) unlet g:airline#init#bootstrapping endfunction @@ -107,7 +107,7 @@ function! airline#init#sections() let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3c ']) endif if !exists('g:airline_section_warning') - let g:airline_section_warning = airline#section#create(['syntastic', 'whitespace']) + let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace']) endif endfunction diff --git a/t/init.vim b/t/init.vim index a7d3d2c..86efe58 100644 --- a/t/init.vim +++ b/t/init.vim @@ -62,6 +62,7 @@ describe 'init sections' Expect airline#parts#get('branch').raw == '' Expect airline#parts#get('tagbar').raw == '' Expect airline#parts#get('syntastic').raw == '' + Expect airline#parts#get('eclim').raw == '' Expect airline#parts#get('whitespace').raw == '' end end