diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index f30f2ae..6496bd9 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index ee1f7b9..a098dd9 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -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