diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index e54829e..a5a5958 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -67,7 +67,7 @@ function! airline#init#bootstrap() \ 'highlight': 'airline_file', \ }) call airline#parts#define_raw('file', '%f%m') - call airline#parts#define_raw('ffenc', '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}') + call airline#parts#define_function('ffenc', 'airline#parts#ffenc') call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace']) endfunction diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index 9abbb89..56afc05 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -61,3 +61,7 @@ function! airline#parts#filetype() return &filetype endfunction +function! airline#parts#ffenc() + return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '') +endfunction +