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.)
getline
which turned out to be cygwin doing something weird. Resulted in aCR+LF
instead of the UnixLF
or even a dos styleLF+CR
. You should check and see what line ending style you have configured in cygwin but YMMV. See also http://cygwin.com/faq/faq-nochunks.html#faq.api.cr-lf – Matt Aug 03 '12 at 01:52CR+LF
, notLF+CR
. – echristopherson Aug 03 '12 at 03:17set number
line, 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). – iconoclast Aug 03 '12 at 13:52