deprecate fugitive variable names in favour of scm-agnostic variable names
This commit is contained in:
parent
0c7687889e
commit
161daa7942
@ -74,9 +74,13 @@ function! airline#update_externals()
|
||||
\ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string()
|
||||
\ : "%f%m"
|
||||
let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') ? '%{SyntasticStatuslineFlag()}' : ''
|
||||
let g:airline_externals_fugitive = g:airline_enable_fugitive ? (exists('*fugitive#head') && strlen(fugitive#head()) > 0
|
||||
\ ? g:airline_fugitive_prefix.fugitive#head() : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0
|
||||
\ ? g:airline_fugitive_prefix.lawrencium#statusline() : '') : ''
|
||||
let g:airline_externals_branch = g:airline_enable_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! s:get_section(key)
|
||||
|
@ -51,7 +51,7 @@ values):
|
||||
|
||||
* enable/disable fugitive/lawrencium integration
|
||||
>
|
||||
let g:airline_enable_fugitive=1
|
||||
let g:airline_enable_branch=1
|
||||
<
|
||||
|
||||
* enable/disable syntastic integration
|
||||
@ -127,7 +127,7 @@ separators, as well as the powerline font glyths.
|
||||
let g:airline_linecolumn_prefix = '␊ '
|
||||
let g:airline_linecolumn_prefix = ' '
|
||||
let g:airline_linecolumn_prefix = '¶ '
|
||||
let g:airline_fugitive_prefix = '⎇ '
|
||||
let g:airline_branch_prefix = '⎇ '
|
||||
let g:airline_paste_symbol = 'ρ'
|
||||
let g:airline_paste_symbol = 'Þ'
|
||||
let g:airline_paste_symbol = '∥'
|
||||
@ -137,7 +137,7 @@ separators, as well as the powerline font glyths.
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep = ''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_fugitive_prefix = ' '
|
||||
let g:airline_branch_prefix = ' '
|
||||
let g:airline_readonly_symbol = ''
|
||||
let g:airline_linecolumn_prefix = ' '
|
||||
|
||||
@ -146,7 +146,7 @@ separators, as well as the powerline font glyths.
|
||||
let g:airline_left_alt_sep = '⮁'
|
||||
let g:airline_right_sep = '⮂'
|
||||
let g:airline_right_alt_sep = '⮃'
|
||||
let g:airline_fugitive_prefix = '⭠'
|
||||
let g:airline_branch_prefix = '⭠'
|
||||
let g:airline_readonly_symbol = '⭤'
|
||||
let g:airline_linecolumn_prefix = '⭡'
|
||||
<
|
||||
@ -164,7 +164,7 @@ with the usual statusline syntax.
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
|
||||
" here is an example of how you could replace the fugitive indicator with
|
||||
" here is an example of how you could replace the branch indicator with
|
||||
" the current working directory, followed by the filename.
|
||||
let g:airline_section_b = '%{getcwd()}'
|
||||
let g:airline_section_c = '%t'
|
||||
|
@ -8,17 +8,20 @@ function! s:check_defined(variable, default)
|
||||
let {a:variable} = a:default
|
||||
endif
|
||||
endfunction
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables have been deprecated and renamed to g:airline_enable_branch and g:airline_branch_prefix respectively. Please update your vimrc.'
|
||||
endif
|
||||
call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?"":">")
|
||||
call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">")
|
||||
call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<")
|
||||
call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<")
|
||||
call s:check_defined('g:airline_enable_bufferline', 1)
|
||||
call s:check_defined('g:airline_enable_fugitive', 1)
|
||||
call s:check_defined('g:airline_enable_branch', 1)
|
||||
call s:check_defined('g:airline_enable_syntastic', 1)
|
||||
call s:check_defined('g:airline_detect_iminsert', 0)
|
||||
call s:check_defined('g:airline_detect_modified', 1)
|
||||
call s:check_defined('g:airline_detect_paste', 1)
|
||||
call s:check_defined('g:airline_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'')
|
||||
call s:check_defined('g:airline_branch_prefix', exists('g:airline_powerline_fonts')?' ':'')
|
||||
call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO')
|
||||
call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':')
|
||||
call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE')
|
||||
@ -46,7 +49,7 @@ function! s:init()
|
||||
call airline#update_externals()
|
||||
call airline#load_theme(g:airline_theme)
|
||||
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_branch}')
|
||||
call s:check_defined('g:airline_section_c', g:airline_externals_bufferline)
|
||||
call s:check_defined('g:airline_section_gutter', '')
|
||||
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
|
||||
|
Loading…
Reference in New Issue
Block a user