improve vimshell integration; support interactive modes
This commit is contained in:
parent
c7cc63fb62
commit
8d4eb3c574
|
@ -17,12 +17,13 @@ let s:filetype_overrides = {
|
||||||
\ 'undotree': [ 'undotree', '' ],
|
\ 'undotree': [ 'undotree', '' ],
|
||||||
\ 'gundo': [ 'Gundo', '' ],
|
\ 'gundo': [ 'Gundo', '' ],
|
||||||
\ 'diff': [ 'diff', '' ],
|
\ 'diff': [ 'diff', '' ],
|
||||||
\ 'vimshell': [ 'vimshell', '%{vimshell#get_status_string()}' ],
|
|
||||||
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
|
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
|
||||||
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
|
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
|
||||||
\ 'startify': [ 'startify', '' ],
|
\ 'startify': [ 'startify', '' ],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
let s:filetype_regex_overrides = {}
|
||||||
|
|
||||||
function! airline#extensions#apply_left_override(section1, section2)
|
function! airline#extensions#apply_left_override(section1, section2)
|
||||||
let w:airline_section_a = a:section1
|
let w:airline_section_a = a:section1
|
||||||
let w:airline_section_b = a:section2
|
let w:airline_section_b = a:section2
|
||||||
|
@ -58,6 +59,12 @@ function! airline#extensions#update_statusline()
|
||||||
let args = s:filetype_overrides[&ft]
|
let args = s:filetype_overrides[&ft]
|
||||||
call airline#extensions#apply_left_override(args[0], args[1])
|
call airline#extensions#apply_left_override(args[0], args[1])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
for item in items(s:filetype_regex_overrides)
|
||||||
|
if match(&ft, item[0]) >= 0
|
||||||
|
call airline#extensions#apply_left_override(item[1][0], item[1][1])
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#is_excluded_window()
|
function! airline#extensions#is_excluded_window()
|
||||||
|
@ -123,6 +130,11 @@ function! airline#extensions#load()
|
||||||
call airline#extensions#tagbar#init(s:ext)
|
call airline#extensions#tagbar#init(s:ext)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists(':VimShell')
|
||||||
|
let s:filetype_overrides['vimshell'] = ['vimshell','%{vimshell#get_status_string()}']
|
||||||
|
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
|
||||||
|
endif
|
||||||
|
|
||||||
if g:airline_enable_branch && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0))
|
if g:airline_enable_branch && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0))
|
||||||
call airline#extensions#branch#init(s:ext)
|
call airline#extensions#branch#init(s:ext)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue