move ctrlp into new extensions area

This commit is contained in:
Bailey Ling 2013-07-07 12:41:36 +00:00
parent 51c1e25479
commit 25758970fc
3 changed files with 14 additions and 14 deletions

View File

@ -0,0 +1,9 @@
function! airline#extensions#load()
if exists('g:loaded_ctrlp') && g:loaded_ctrlp
call airline#extensions#ctrlp#load_ctrlp_hi()
let g:ctrlp_status_func = {
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
\ }
endif
endfunction

View File

@ -1,5 +1,6 @@
" TODO: support loading color palette from g:airline_theme
function! airline#themes#ctrlp#load_ctrlp_hi() function! airline#extensions#ctrlp#load_ctrlp_hi()
hi! CtrlPdark ctermfg=189 ctermbg=55 guifg=#d7d7ff guibg=#5f00af hi! CtrlPdark ctermfg=189 ctermbg=55 guifg=#d7d7ff guibg=#5f00af
hi! CtrlPlight ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7 hi! CtrlPlight ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7
hi! CtrlPwhite ctermfg=55 ctermbg=231 term=bold guifg=#5f00af guibg=#ffffff gui=bold hi! CtrlPwhite ctermfg=55 ctermbg=231 term=bold guifg=#5f00af guibg=#ffffff gui=bold
@ -14,7 +15,7 @@ endfunction
" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked " Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
" a:1 a:2 a:3 a:4 a:5 a:6 a:7 " a:1 a:2 a:3 a:4 a:5 a:6 a:7
function! airline#themes#ctrlp#ctrlp_airline(...) function! airline#extensions#ctrlp#ctrlp_airline(...)
let regex = a:3 ? '%#CtrlPlight# regex %*' : '' let regex = a:3 ? '%#CtrlPlight# regex %*' : ''
let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep
let item = '%#CtrlPwhite# '.a:5.' %#CtrlParrow2#'.g:airline_left_sep let item = '%#CtrlPwhite# '.a:5.' %#CtrlParrow2#'.g:airline_left_sep
@ -29,11 +30,9 @@ endfunction
" Argument: len " Argument: len
" a:1 " a:1
function! airline#themes#ctrlp#ctrlp_airline_status(...) function! airline#extensions#ctrlp#ctrlp_airline_status(...)
let len = '%#CtrlPwhite# '.a:1 let len = '%#CtrlPwhite# '.a:1
let dir = '%=%<%#CtrlParrow5#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*' let dir = '%=%<%#CtrlParrow5#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
" Return the full statusline " Return the full statusline
return len.dir return len.dir
endfunction endfunction

View File

@ -26,15 +26,6 @@ call s:check_defined('g:airline_exclude_filetypes', ['qf','netrw','diff','undotr
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:load_the_theme = g:airline#themes#{g:airline_theme}#normal let s:load_the_theme = g:airline#themes#{g:airline_theme}#normal
if exists('g:loaded_ctrlp') && g:loaded_ctrlp
call airline#themes#ctrlp#load_ctrlp_hi()
" ctrlp only looks for this
let g:ctrlp_status_func = {
\ 'main': 'airline#themes#ctrlp#ctrlp_airline',
\ 'prog': 'airline#themes#ctrlp#ctrlp_airline_status',
\ }
endif
call s:check_defined('g:airline_mode_map', { call s:check_defined('g:airline_mode_map', {
\ 'n' : 'NORMAL', \ 'n' : 'NORMAL',
\ 'i' : 'INSERT', \ 'i' : 'INSERT',
@ -100,6 +91,7 @@ function! s:update_externals()
\ ? g:airline_fugitive_prefix.fugitive#head() : '' \ ? g:airline_fugitive_prefix.fugitive#head() : ''
if !s:airline_sections_defined if !s:airline_sections_defined
call airline#extensions#load()
call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text}') call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text}')
call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}') call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}')
call s:check_defined('g:airline_section_c', g:airline_externals_bufferline) call s:check_defined('g:airline_section_c', g:airline_externals_bufferline)