Merge pull request #1180 from ratijas/master

add obsession extension
This commit is contained in:
Christian Brabandt 2016-05-30 19:58:07 +02:00
commit 64f06309b1
4 changed files with 35 additions and 2 deletions

View File

@ -250,6 +250,10 @@ function! airline#extensions#load()
call airline#extensions#windowswap#init(s:ext)
endif
if (get(g:, 'airline#extensions#obsession#enabled', 1) && exists('*ObsessionStatus'))
call airline#extensions#obsession#init(s:ext)
endif
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path).

View File

@ -0,0 +1,20 @@
" vim: et ts=2 sts=2 sw=2
if !exists('*ObsessionStatus')
finish
endif
let s:spc = g:airline_symbols.space
if !exists('g:airline#extensions#obsession#indicator_text')
let g:airline#extensions#obsession#indicator_text = '$'
endif
function! airline#extensions#obsession#init(ext)
call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status')
endfunction
function! airline#extensions#obsession#get_status()
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '')
endfunction

View File

@ -93,7 +93,7 @@ function! airline#init#bootstrap()
\ 'raw': '%#__accent_bold#/%L%{g:airline_symbols.maxlinenr}%#__restore__#',
\ 'accent': 'bold'})
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic',
call airline#parts#define_empty(['hunks', 'branch', 'obsession', 'tagbar', 'syntastic',
\ 'eclim', 'whitespace','windowswap', 'ycm_error_count', 'ycm_warning_count'])
call airline#parts#define_text('capslock', '')
@ -131,7 +131,7 @@ function! airline#init#sections()
let g:airline_section_y = airline#section#create_right(['ffenc'])
endif
if !exists('g:airline_section_z')
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v'])
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v'])
endif
if !exists('g:airline_section_error')
let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic', 'eclim'])

View File

@ -718,6 +718,15 @@ vim-windowswap <https://github.com/wesQ3/vim-windowswap>
* set marked window indicator string >
let g:airline#extensions#windowswap#indicator_text = 'WS'
<
------------------------------------- *airline-obsession*
vim-obsession <https://github.com/tpope/vim-obsession>
* enable/disable vim-obsession integration >
let g:airline#extensions#obsession#enabled = 1
* set marked window indicator string >
let g:airline#extensions#obsession#indicator_text = '$'
<
------------------------------------- *airline-taboo*
taboo.vim <https://github.com/gcmt/taboo.vim>