mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-12 13:23:35 +08:00
reduce pollution of global scope variables
This commit is contained in:
parent
ee19bf8825
commit
494d15232c
|
@ -1,6 +1,11 @@
|
||||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||||
" vim: et ts=2 sts=2 sw=2
|
" 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',
|
||||||
|
\ get(g:, 'airline_branch_prefix', exists('g:airline_powerline_fonts') ? ' ' : ''))
|
||||||
|
|
||||||
let s:has_fugitive = exists('*fugitive#head')
|
let s:has_fugitive = exists('*fugitive#head')
|
||||||
let s:has_fugitive_detect = exists('*fugitive#detect')
|
let s:has_fugitive_detect = exists('*fugitive#detect')
|
||||||
let s:has_lawrencium = exists('*lawrencium#statusline')
|
let s:has_lawrencium = exists('*lawrencium#statusline')
|
||||||
|
@ -23,7 +28,7 @@ function! airline#extensions#branch#get_head()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return empty(head) ? g:airline_branch_empty_message : g:airline_branch_prefix.head
|
return empty(head) ? s:empty_message : s:symbol.head
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#branch#init(ext)
|
function! airline#extensions#branch#init(ext)
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
" vim: et ts=2 sts=2 sw=2
|
||||||
|
|
||||||
if !exists('g:airline#extensions#csv#column_display')
|
let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number')
|
||||||
let g:airline#extensions#csv#column_display = 'Number'
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! airline#extensions#csv#get_column()
|
function! airline#extensions#csv#get_column()
|
||||||
if exists('*CSV_WCol')
|
if exists('*CSV_WCol')
|
||||||
if g:airline#extensions#csv#column_display ==# 'Name'
|
if s:column_display ==# 'Name'
|
||||||
return '['.CSV_WCol('Name').CSV_WCol().']'
|
return '['.CSV_WCol('Name').CSV_WCol().']'
|
||||||
else
|
else
|
||||||
return '['.CSV_WCol().']'
|
return '['.CSV_WCol().']'
|
||||||
|
|
|
@ -125,7 +125,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_linecolumn_prefix = ' '
|
||||||
let g:airline_linecolumn_prefix = '¶ '
|
let g:airline_linecolumn_prefix = '¶ '
|
||||||
let g:airline_branch_prefix = '⎇ '
|
let g:airline#extensions#branch#symbol = '⎇ '
|
||||||
let g:airline_paste_symbol = 'ρ'
|
let g:airline_paste_symbol = 'ρ'
|
||||||
let g:airline_paste_symbol = 'Þ'
|
let g:airline_paste_symbol = 'Þ'
|
||||||
let g:airline_paste_symbol = '∥'
|
let g:airline_paste_symbol = '∥'
|
||||||
|
@ -136,7 +136,7 @@ separators, as well as the powerline font glyths.
|
||||||
let g:airline_left_alt_sep = ''
|
let g:airline_left_alt_sep = ''
|
||||||
let g:airline_right_sep = ''
|
let g:airline_right_sep = ''
|
||||||
let g:airline_right_alt_sep = ''
|
let g:airline_right_alt_sep = ''
|
||||||
let g:airline_branch_prefix = ' '
|
let g:airline#extensions#branch#symbol = ' '
|
||||||
let g:airline_readonly_symbol = ''
|
let g:airline_readonly_symbol = ''
|
||||||
let g:airline_linecolumn_prefix = ' '
|
let g:airline_linecolumn_prefix = ' '
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ separators, as well as the powerline font glyths.
|
||||||
let g:airline_left_alt_sep = '⮁'
|
let g:airline_left_alt_sep = '⮁'
|
||||||
let g:airline_right_sep = '⮂'
|
let g:airline_right_sep = '⮂'
|
||||||
let g:airline_right_alt_sep = '⮃'
|
let g:airline_right_alt_sep = '⮃'
|
||||||
let g:airline_branch_prefix = '⭠'
|
let g:airline#extensions#branch#symbol = '⭠'
|
||||||
let g:airline_readonly_symbol = '⭤'
|
let g:airline_readonly_symbol = '⭤'
|
||||||
let g:airline_linecolumn_prefix = '⭡'
|
let g:airline_linecolumn_prefix = '⭡'
|
||||||
<
|
<
|
||||||
|
@ -182,7 +182,7 @@ lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||||
let g:airline_enable_branch = 1
|
let g:airline_enable_branch = 1
|
||||||
<
|
<
|
||||||
* change the text for when no branch is detected >
|
* change the text for when no branch is detected >
|
||||||
let g:airline_branch_empty_message = ''
|
let g:airline#extensions#branch#empty_message = ''
|
||||||
<
|
<
|
||||||
*airline-syntastic*
|
*airline-syntastic*
|
||||||
syntastic <https://github.com/scrooloose/syntastic>
|
syntastic <https://github.com/scrooloose/syntastic>
|
||||||
|
|
|
@ -25,8 +25,6 @@ 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_modified', 1)
|
||||||
call s:check_defined('g:airline_detect_paste', 1)
|
call s:check_defined('g:airline_detect_paste', 1)
|
||||||
call s:check_defined('g:airline_detect_whitespace', 1)
|
call s:check_defined('g:airline_detect_whitespace', 1)
|
||||||
call s:check_defined('g:airline_branch_empty_message', '')
|
|
||||||
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_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_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':')
|
||||||
call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE')
|
call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user