On Windows, most distributions uses dos
as default format, and note that set fileformat=unix
on vimrc cannot affect with newly created buffer. Use fileformats
rather than fileformat
.
" ~/.vimrc or ~/_vimrc (depends on distribution)
set fileformats=unix,dos