I have the following line in my init.vim:
if !&readonly
set fileencoding=utf-8
endif
Which sets the fileencoding to utf-8. It works fine, unless I have my cursor in a nerdtree window, in which case I get the following error:
I guess that it's trying to set the nerdtree window to utf-8. I think that I could solve this by checking for nerdtree in the if statement (so that it doesn't try to set fileencoding for nerdtree windows). How do I do that?