Notepad++ Quick Trick #2 – Adding Line Breaks

My Quick Trick #2

Since you are editing text in Notepad ++, and you have already used Quick Tip #1 to mark specific lines of code, say containg <span> you might need to break the whole line in two lines so that a new line break forms after the <span> part of the code.

From this:

More Html Code here <span>Santa is Coming</span> More Html  Code here

To This:

More Html Code here <span>
Santa is Coming
</span> More Html  Code here

An easy way to do this by using the search and replace menu of notepad ++ . You need to seach for a part of the code where you want the break to occur, and then replace for the same part adding the escape sequence of the line break “\n” at the end. Make sure you have enabled “Extended Search Mode” at the bottom of the search window.

Adding Line Breaks

Additional Espace Sequences can be used in the same way:

 \" – double quote
 \\ – single backslash
 \a – bell/alert
 \b – backspace
 \r – carriage return
 \n – newline
 \s – space
 \t – tab



Leave a Reply