Make fileformat output truncatable

closes #1309
This commit is contained in:
Christian Brabandt 2016-12-13 21:44:57 +01:00
parent a0ea8db1fc
commit a69834f7dc
2 changed files with 14 additions and 1 deletions

View File

@ -88,5 +88,12 @@ function! airline#parts#filetype()
endfunction
function! airline#parts#ffenc()
return printf('%s%s%s', &fenc, &l:bomb ? '[BOM]' : '', strlen(&ff) > 0 ? '['.&ff.']' : '')
let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
let bomb = &l:bomb ? '[BOM]' : ''
let ff = strlen(&ff) ? '['.&ff.']' : ''
if expected is# &fenc.bomb.ff
return ''
else
return &fenc.bomb.ff
endif
endfunction

View File

@ -300,6 +300,12 @@ configuration values that you can use.
Try setting this to zero, if you notice bleeding color artifacts >
let airline#extensions#default#section_use_groupitems = 1
<
* configure the fileformat output
By default, it will display something like 'utf-8[unix]', however, you can
skip displaying it, if the output matches a configured string. To do so,
set >
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
<
------------------------------------- *airline-quickfix*
The quickfix extension is a simple built-in extension which determines
whether the buffer is a quickfix or location list buffer, and adjusts the