shorten filetype for smaller screens

This commit is contained in:
Christian Brabandt 2016-07-03 21:32:33 +02:00
parent 8fda614d0d
commit fdd29caef4

View File

@ -82,10 +82,9 @@ function! airline#parts#readonly()
endfunction
function! airline#parts#filetype()
return &filetype
return winwidth(0) < 100 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). '…' : &filetype
endfunction
function! airline#parts#ffenc()
return printf('%s%s%s', &fenc, &l:bomb ? '[BOM]' : '', strlen(&ff) > 0 ? '['.&ff.']' : '')
endfunction