I'm looking for some kind of plugin / vi code that detects if there are any ^M (carriage returns?) In any files or any signs that the line endings are not unix, and if so, delete them or run dos2unix in the file.
I need this to work automatically before / during file opening.
Also, for people who are going to suggest ways to convert line endings manually, one answer points to :set ff=unix , but that doesn't kill ^M in the unix file, I think.
And is there a trick to use :%s/^M//g , because using the literal ^ doesn't match char?
vim
meder omuraliev
source share