" Stick with the UTF-8 encoding.
" Encoding used for the terminal.
let &termencoding = &encoding
" Encoding used in buffers, registers, strings in expressions, "viminfo"
" file, etc.
" Encoding used for writing files.
" Use both Unix and DOS file formats, but favor the Unix one for new files.
NOTE: The merit of the last line is that both formats are displayed correctly in Vim buffer. For example, if you'd remove
fileformats, then all the
dos files that you would open in Vim from now on would be cluttered with
^M symbols at line endings. This
^M is nothing else, but
\r which Vim, in this case, would fail to interpret properly. Therefore, it is strongly recommended to keep
fileformats as shown above. Don't worry, any new files that you create will be using
unix format by default (as stated in the comment above).
If you encounter some file with
dos format and want to convert it into
unix, then type the following: