Suppose you have a list like this
foo, bar, baz, quux
in your Emacs buffer, but you’d rather have one element per line like this
What to do? In vim this is easy:
where ^M is inserted using
But what to do in Emacs? Turns out it’s just as easy but different (who would have thought …): You can insert the newline character in your replace-string or something other using the keyboard command
C-q is somewhat like Ctrl-v in vim and C-j is Enter. Easy as pi, yeah!
See also the page Newline Representations ^M ^J ^L about related issues with newline in Emacs.