Newline Character in Emacs Search and Replace

by Ben Ackland on Mar 26, 2008
Filed Under:

If you want to search for something and replace it with a newline (or some text containing a newline), to enter a newline character into the "replace" box, use:

C-q C-j

I.e. Ctrl-q then Ctrl-j.