I want to realize a different color in my statusline if a file has no utf8 encoding.
This is what I use now:
set statusline+=%3*\ F:%{&fileencoding?&fileencoding:&fileencoding}
hi User3 guifg=#292b00 guibg=#f4f597
This is what I want to realize:
set statusline+=%{Fenc()}*\ F:%{&fileencoding?&fileencoding:&fileencoding}
function! Fenc()
if &fenc !~ "utf-8"
return "4"
else
return "3"
endif
endfunction
hi User3 guifg=#292b00 guibg=#f4f597
hi User4 guifg=#ff0000 guibg=#f4f597
Why doesn't this work?