diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 8a83a31b..4edeedd7 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -1,14 +1,18 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 -let s:empty_message = get(g:, 'airline#extensions#branch#empty_message', - \ get(g:, 'airline_branch_empty_message', '')) -let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) - let s:has_fugitive = exists('*fugitive#head') let s:has_fugitive_detect = exists('*fugitive#detect') let s:has_lawrencium = exists('*lawrencium#statusline') +if !s:has_fugitive && !s:has_lawrencium + finish +endif + +let s:empty_message = get(g:, 'airline#extensions#branch#empty_message', + \ get(g:, 'airline_branch_empty_message', '')) +let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) + function! airline#extensions#branch#get_head() let head = '' diff --git a/autoload/airline/extensions/bufferline.vim b/autoload/airline/extensions/bufferline.vim index cc13ec0d..cb9e1b30 100644 --- a/autoload/airline/extensions/bufferline.vim +++ b/autoload/airline/extensions/bufferline.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !exists('*bufferline#get_status_string') + finish +endif + let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1) function! airline#extensions#bufferline#init(ext) diff --git a/autoload/airline/extensions/commandt.vim b/autoload/airline/extensions/commandt.vim index c1e78902..1353940b 100644 --- a/autoload/airline/extensions/commandt.vim +++ b/autoload/airline/extensions/commandt.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'command_t_loaded', 0) + finish +endif + function! airline#extensions#commandt#apply(...) if bufname('%') ==# 'GoToFile' call airline#extensions#apply_left_override('CommandT', '') diff --git a/autoload/airline/extensions/csv.vim b/autoload/airline/extensions/csv.vim index 99702d0d..e171732d 100644 --- a/autoload/airline/extensions/csv.vim +++ b/autoload/airline/extensions/csv.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'loaded_csv', 0) + finish +endif + let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number') function! airline#extensions#csv#get_column() diff --git a/autoload/airline/extensions/ctrlp.vim b/autoload/airline/extensions/ctrlp.vim index d3a696b0..a39c70bc 100644 --- a/autoload/airline/extensions/ctrlp.vim +++ b/autoload/airline/extensions/ctrlp.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'loaded_ctrlp', 0) + finish +endif + let s:color_template = get(g:, 'airline#extensions#ctrlp#color_template', 'insert') function! airline#extensions#ctrlp#generate_color_map(dark, light, white) diff --git a/autoload/airline/extensions/example.vim b/autoload/airline/extensions/example.vim index 735fbe92..09083dd9 100644 --- a/autoload/airline/extensions/example.vim +++ b/autoload/airline/extensions/example.vim @@ -1,6 +1,9 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +" we don't actually want this loaded :P +finish + " Extension specific variables can be defined the usual fashion. if !exists('g:airline#extensions#example#number_of_cats') let g:airline#extensions#example#number_of_cats = 42 diff --git a/autoload/airline/extensions/hunks.vim b/autoload/airline/extensions/hunks.vim index 57e08321..73c0e2ea 100644 --- a/autoload/airline/extensions/hunks.vim +++ b/autoload/airline/extensions/hunks.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) + finish +endif + let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0) let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-']) diff --git a/autoload/airline/extensions/syntastic.vim b/autoload/airline/extensions/syntastic.vim index a91ec664..4e35f0d3 100644 --- a/autoload/airline/extensions/syntastic.vim +++ b/autoload/airline/extensions/syntastic.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !exists(':SyntasticCheck') + finish +endif + function! airline#extensions#syntastic#get_warnings() let errors = SyntasticStatuslineFlag() if strlen(errors) > 0 diff --git a/autoload/airline/extensions/tagbar.vim b/autoload/airline/extensions/tagbar.vim index 5eb08687..d786abf2 100644 --- a/autoload/airline/extensions/tagbar.vim +++ b/autoload/airline/extensions/tagbar.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !exists(':TagbarToggle') + finish +endif + let s:flags = get(g:, 'airline#extensions#tagbar#flags', '') " Arguments: current, sort, fname diff --git a/autoload/airline/extensions/undotree.vim b/autoload/airline/extensions/undotree.vim index 3de1712f..d897f041 100644 --- a/autoload/airline/extensions/undotree.vim +++ b/autoload/airline/extensions/undotree.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !exists(':UndotreeToggle') + finish +endif + function! airline#extensions#undotree#apply(...) if exists('t:undotree') if &ft == 'undotree' diff --git a/autoload/airline/extensions/unite.vim b/autoload/airline/extensions/unite.vim index 217309ce..4db38584 100644 --- a/autoload/airline/extensions/unite.vim +++ b/autoload/airline/extensions/unite.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'loaded_unite', 0) + finish +endif + function! airline#extensions#unite#apply(...) if &ft == 'unite' call a:1.add_section('airline_a', ' Unite ') diff --git a/autoload/airline/extensions/virtualenv.vim b/autoload/airline/extensions/virtualenv.vim index 1e7435e7..7b564a96 100644 --- a/autoload/airline/extensions/virtualenv.vim +++ b/autoload/airline/extensions/virtualenv.vim @@ -1,6 +1,10 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +if !get(g:, 'virtualenv_loaded', 0) + finish +endif + function! airline#extensions#virtualenv#init(ext) call a:ext.add_statusline_func('airline#extensions#virtualenv#apply') endfunction