" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2

scriptencoding utf-8

function! s:check_defined(variable, default)
  if !exists(a:variable)
    let {a:variable} = a:default
  endif
endfunction

let s:loaded = 0
function! airline#init#bootstrap()
  if s:loaded
    return
  endif
  let s:loaded = 1

  let g:airline#init#bootstrapping = 1

  let g:airline#init#vim_async = (v:version >= 800 && has('job'))
  let g:airline#init#is_windows = has('win32') || has('win64')

  call s:check_defined('g:airline_detect_modified', 1)
  call s:check_defined('g:airline_detect_paste', 1)
  call s:check_defined('g:airline_detect_crypt', 1)
  call s:check_defined('g:airline_detect_spell', 1)
  call s:check_defined('g:airline_detect_spelllang', 1)
  call s:check_defined('g:airline_detect_iminsert', 0)
  call s:check_defined('g:airline_inactive_collapse', 1)
  call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
  call s:check_defined('g:airline_exclude_filetypes', [])
  call s:check_defined('g:airline_exclude_preview', 0)

  " If g:airline_mode_map_codes is set to 1 in your .vimrc it will display
  " only the modes' codes in the status line. Refer :help mode() for codes.
  " That may be a preferred presentation because it is minimalistic.
  call s:check_defined('g:airline_mode_map_codes', 0)
  call s:check_defined('g:airline_mode_map', {})

  if g:airline_mode_map_codes != 1
    " If you prefer different mode names than those below they can be
    " customised by inclusion in your .vimrc - for example, including just:
    " let g:airline_mode_map = {
    "    \ 'Rv' : 'VIRTUAL REPLACE',
    "    \ 'niV' : 'VIRTUAL REPLACE (NORMAL)',
    "    \ }
    " ...would override 'Rv' and 'niV' below respectively.
    call extend(g:airline_mode_map, {
        \ '__' : '------',
        \ 'n' : 'NORMAL',
        \ 'no' : 'OP PENDING',
        \ 'nov' : 'OP PENDING CHAR',
        \ 'noV' : 'OP PENDING LINE',
        \ 'no