I often have to edit script files, an interpreter for which treats files with the EOL marker in the last line of the file as an error (that is, the file treats CRLF as "new lines", and not as "end lines").
I am currently opening these files in Vim using binary mode (-b on the command line). It automatically detects the absence of EOL in the final line and accordingly sets the "noeol" option, which prevents it from writing EOL on the last line.
Since the file has CRLF line endings, I get a lot ^Mat the end of my lines (because it only interprets Unix-style line endings in binary mode). I cannot open it in text mode because the "noeol" option is ignored for non-binary files.
This is very annoying, and I must always remember to manually enter ^Mat the end of each line! Is there any way to get it to accept DOS-style line endings in binary mode, or make it listen to the EOL parameter in text mode?
source
share