Replace \n with actual new line in Sublime Text

leemour picture leemour · Dec 11, 2013 · Viewed 315.9k times · Source

How can I replace \n in Sublime Text with real in-editor displayed new line so:

foo\nbar

becomes:

foo
bar

in the editor when I view the file in it.

Answer

chrisg86 picture chrisg86 · Dec 11, 2013

Turn on Regex Search and Replace (icon most to the left in search and replace bar or shortcut Alt + R)

Find What: \\n
Replace with: \n

Cheers