Word – How to make Word Wrap insert newlines in Notepad++

notepadword wrap

I know kate has a feature that automatically breaks a line with a newline if the line
exceeds beyond a certain number of characters like 80.

Notepad++ has a word wrap feature under the Views table, but it doesn't insert a newline
character. It simply splits long lines visually without inserting actual newlines.

Is there a plug-in or feature in Notepad++ to automatically break long lines using newlines automatically?

Best Answer

I don't know if there's a plugin, and I can't find any menu item to do this but it can be done with regular expression replace all...

  • Find: \s(?<=.{80})
  • Replace: $0\r\n

This will find the nearest space \s after 80 characters look behind (?<=.{80}) and replace with the entire match $0 followed by carriage return \r & new line \n for DOS/Windows.

Use just a new line \n for Linux.

Related Question