How do you insert literal control chars in vim on Mac?

How do you insert literal control characters in vi on Mac?

For example what is the Mac equivalent of

Unix ^V^M Windows ^Q^M (in vim)

to insert a \r into a substitution string?


Solution 1:

It's the same like in Unix/Linux:

^V^M

But, if you want to use the character in a substitution string, then you should write it like it is, \r, e.g.

:%s/blabla/\r/