On 19/09/11 16:17, Ernie Rael wrote:
Suggest looking at help for 'fileformats'/'ffs' . Something like "set
fileformats=unix,dos" in your .vimrc might be what you're looking for.

-ernie

That will open correctly files whose lines are all-LF-only (Unix-style) or all-CR+LF (Dos-style) provided in the latter case that even the last line has a Dos-style EOF. It won't work for files with mixed ends-of-lines (some CR+LF, others LF-only, which is what the OP mentioned) and it will also not work on Dos-style files whose last line lacks an EOL (i.e. Dos-style files whose last two bytes are other than 0x0D 0x0A).


On 9/19/2011 2:42 AM, Ron Aaron wrote:
I'm working in a mixed environment, and many of my co-workers use
(bad) editors on Windows. So we have a number of files with a mix of
CR-LF and plain LF in them. "vim" always displays these with a "^M".

I can get rid of that by just doing ":%s/^M//", but then I change the
file, and I don't want to do that. It is also impossible for me to
enforce file format conventions.

Therefore I wonder if there is at least some way to just not display
the trailing "^M", since it is "visual noise" for the most part and
doesn't cause any other tools we use any problems.

Thanks,
Ron



Best regards,
Tony.
--
If you want to know what god thinks of money, just look at the people
he gave it to.
                -- Dorthy Parker

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui