2

I have a file with fileformat=dos where vim shows all newline characters as ^M. However, when I try to fix this by replacing all occurrences of ^M with \r using

:%s/<Ctrl-V><Ctrl-M>/\r/g

then the command is not performed globally but stops after the first ^M character is replaced?

Will Durst
  • 59
  • 1
  • 5

1 Answers1

3

I found the answer thanks to Micheal's comment:

Are the gdefault or edcompatible options off? Read :help s_flags.

After setting :set nogdefault the substitution is now global.

Will Durst
  • 59
  • 1
  • 5