I have
set fileformat=unix
in my .vimrc, and yet if I create a file in vim (running in Cygwin) it persists in creating DOS-format files, and I have to run them through dos2unix to clean them. (I guess I don't really have to, since Git cleans them up for me, but it just bugs me to death that a Unix text editor, which I've specifically instructed to use Unix line endings, is polluting them with extra garbage.)
Why would this happen? How can I fix it? (And by "fix" I do not mean something that requires me to convert each file individually. That's not a fix. That's what's totally broken.)
getlinewhich turned out to be cygwin doing something weird. Resulted in aCR+LFinstead of the UnixLFor even a dos styleLF+CR. You should check and see what line ending style you have configured in cygwin but YMMV. See also cygwin.com/faq/faq-nochunks.html#faq.api.cr-lfCR+LF, notLF+CR.set numberline, and it took effect, and uncommented it out and that took effect. I also added "blah blah blah" at the bottom, and got "Press ENTER or type command to continue" when I opened anything, but oddly there was no error message before that (unless it was black letters on black background).