endif
endfunction
- " Display unexpected 'fileformat' and 'fileencoding' settings.
+ " Display unexpected 'fileformat', 'fileencoding' and 'bomb' settings.
function! s:StatuslineFileFormat()
if &fileformat != 'unix'
return '[' . &fileformat . ']'
return ''
endif
endfunction
+ function! s:StatuslineFileBOMB()
+ if exists('+bomb') && &bomb
+ return '[BOM]'
+ else
+ return ''
+ endif
+ endfunction
" Return current syntax group in brackets or nothing if there's none.
function! s:StatuslineSyntaxGroup()
function! SFE()
return s:StatuslineFileEncoding()
endfunction
+ function! SFB()
+ return s:StatuslineFileBOMB()
+ endfunction
function! SSG()
return s:StatuslineSyntaxGroup()
endfunction
set statusline+=%#Error# " display warnings
set statusline+=%{SFF()} " - unexpected file format
set statusline+=%{SFE()} " - unexpected file encoding
+ set statusline+=%{SFB()} " - unexpected file byte order mask
set statusline+=%## " continue with normal colors
endif