‘Word Wrap’ is a text feature that allows you to limit text content to a certain width on the editor window.
If you have a long line of text on a single line, for example, the user will have to scroll horizontally to see the content. With word wrap, the text is spread into multiple lines, and the content is limited to fit within the code window.
Any editor provides this as a basic feature. Out of the box, Notepad++ supports word wrap.
This tutorial will show you how to enable or disable word wrap in the Notepad++ editor in multiple ways.
How do I enable text wrapping in a notepad++?
There are multiple ways, we can enable and disable the word wrap in Notepad++. One way, using the view menu.
Open Notepad++ editor
Go to
View
Menu > SelectWord wrap
itemIt enables the word wrap option and splits the long text content into multiple lines, and the user can see the content without scrolling sideways.
Once this option is enabled, It shows the selected icon and applies to all tabs in Notepad++ editor.
You can also disable it by clicking the Word wrap option in the views menu.
Another way is using the toolbar.
In the Notepad++ editor, There is a toolbar UI element shown between menu and tab items.
Toolbar UI contains different icons that can act as toggle switches on or off during clicking.
You can enable or disable it by selecting the Word Wrap icon in the toolbar.
if you are not sure about the icon, You can hover it to get tooltip text about the icon.
Note: By default, word wrap limits the line text width to window width.
Suppose, if you want to limit the line width after specific characters, See the next section to check
How do I wrap lines in Notepad++ after N symbols?
Word wrap does not insert newlines in Notepad++.
Split the line after n characters Using regular expressions.
This example split the line into multiple after 20 characters.
Here are the following steps
Go to
Search
->Replace
Menu item, or use Shortcut Ctrl + HFind and Replace window shown to the user.
Please do the following things
Find what:
^.{20}
Replace With :$0\r\n
Search Mode: Regular Expression Click on the Replace All button
^.{20}
, It finds and checks for each line for the first 20 characters
$0\r\n
replace line break
It will split the line into multiple lines after the 20th character.