I have posted about making
fileformat=dos persistent in past years, here and here. So far, the best advice is
:set fileformats=dos,unix hidden. It does cause
fileformat=dos to persist, but only for a little while
If I use Netrw to view a folder, then press
o on a file1 to split it open on a subwindow, I can issue
:e ++ff=dos to get rid of the
^M marks at the end of (almost) every line. I can then close the subwindow, go to the next file file2 and do the same thing.
If I close file2 and press
p on file1 to open it in a preview window, it seems fine. If I do the same for file2, however, then return to file1, I get the
This loss of
fileformat=dos is sporadic. That is, sometimes, it seems to OK, but at some point in switching between file1 and file2, it comes back. It seems to rear its head the most when I have two subwindows side-by-side, with Netrw on the left subwindow and the text file being inspected in the right subwindow (either in a preview window or a normal window).
Is there a more robust way to get
fileformat=dos to stick to a buffer/file/subwindow?