mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-09-06 14:57:00 +08:00
Merge branch 'ext'
Conflicts: autoload/airline/extensions.vim
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#branch#apply()
|
||||
let g:airline_current_branch = exists('*fugitive#head') && strlen(fugitive#head()) > 0
|
||||
\ ? g:airline_branch_prefix.fugitive#head()
|
||||
\ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0
|
||||
\ ? g:airline_branch_prefix.lawrencium#statusline()
|
||||
\ : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
|
||||
endfunction
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#bufferline#init(ext)
|
||||
highlight AlBl_active gui=bold cterm=bold term=bold
|
||||
highlight link AlBl_inactive Al6
|
||||
let g:bufferline_inactive_highlight = 'AlBl_inactive'
|
||||
let g:bufferline_active_highlight = 'AlBl_active'
|
||||
let g:bufferline_active_buffer_left = ''
|
||||
let g:bufferline_active_buffer_right = ''
|
||||
let g:bufferline_separator = ' '
|
||||
|
||||
if g:airline_section_c == '%f%m'
|
||||
let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,8 +1,12 @@
|
||||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#commandt#apply_window_override()
|
||||
function! airline#extensions#commandt#apply()
|
||||
if bufname('%') ==# 'GoToFile'
|
||||
call airline#extensions#apply_left_override('CommandT', '')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#commandt#init(ext)
|
||||
call ext.add_statusline_funcref(function('airline#extensions#commandt#apply'))
|
||||
endfunction
|
||||
|
||||
@@ -26,10 +26,7 @@ function! airline#extensions#ctrlp#load_theme()
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Recreate Ctrl-P status line with some slight modifications
|
||||
|
||||
" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
|
||||
" a:1 a:2 a:3 a:4 a:5 a:6 a:7
|
||||
function! airline#extensions#ctrlp#ctrlp_airline(...)
|
||||
let regex = a:3 ? '%#CtrlPlight# regex %*' : ''
|
||||
let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep
|
||||
@@ -39,15 +36,24 @@ function! airline#extensions#ctrlp#ctrlp_airline(...)
|
||||
let focus = '%=%<%#CtrlPdark# '.a:1.' %*'
|
||||
let byfname = '%#CtrlParrow3#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*'
|
||||
let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
|
||||
" Return the full statusline
|
||||
return regex.prv.item.nxt.marked.focus.byfname.dir
|
||||
endfunction
|
||||
|
||||
" Argument: len
|
||||
" a:1
|
||||
function! airline#extensions#ctrlp#ctrlp_airline_status(...)
|
||||
let len = '%#CtrlPdark# '.a:1
|
||||
let dir = '%=%<%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
|
||||
" Return the full statusline
|
||||
return len.dir
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#is_statusline_overwritten()
|
||||
return match(&statusline, 'CtrlPlight') >= 0
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#init(ext)
|
||||
let g:ctrlp_status_func = {
|
||||
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
call a:ext.add_cursormove_funcref(function('airline#extensions#ctrlp#is_statusline_overwritten'))
|
||||
endfunction
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
if g:airline_section_gutter == ''
|
||||
let g:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}'
|
||||
endif
|
||||
endfunction
|
||||
@@ -0,0 +1,14 @@
|
||||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#tagbar#apply()
|
||||
let w:airline_section_x = '%(%{tagbar#currenttag("%s","")} '.g:airline_right_alt_sep.' %)'.g:airline_section_x
|
||||
if &ft == 'tagbar'
|
||||
call airline#extensions#apply_left_override('Tagbar', '%{TagbarGenerateStatusline()}')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tagbar#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#tagbar#apply'))
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user