TIP: Getting VIM to open files in Unicode (UTF8) format by default

Whenever i re-install VIM (aka Vi IMproved) i get the same issue: if i open a file encoded as utf-8 then vim will open it and show control characters in some places.

To fix this simply find your vimrc file (on windows you’ll find it in c:\program files\vim\ - it’s called _vimrc), open it (using vim :) ) and add the line

set encoding=utf-8

Save it and future sessions of vim will now correctly notice the formatting and pick it up accordingly.

Leave a Reply