How to Wrap Lines in Notepad++

Line wrap is continuing the text on a new line when the current line is full. Without the line wrap, the text in lines will exceed the width of the text editor’s window due to which the user will be unable to see the full lines. Some text editors like Notepad++ will not wrap lines by default because they are also used for source codes. Using a horizontal scroll bar can be time-consuming for most users when they are checking some large documents. In this article, we will teach you about how you can wrap lines in Notepad++.

How to Wrap Lines in Notepad++

Wrap Lines by Using the Word Wrap Option

Notepad++ also has the Word Wrap feature like most of the text editors. By default, it will be off and the lines will exceed the width of the Notepad++ window. Users will have to use the horizontal scroll bar to move left and right just to see the remaining text of the line. Users can easily wrap lines within a few steps by using the Word Wrap feature in Notepad++. Word Wrap will keep the size of the lines to the size of the application window. Follow the below steps to try it out:

  1. Open your Notepad++ by double-clicking the shortcut or searching it through the Windows search feature. Click on the File menu in the menu bar and choose the Open option to open your document.
    Opening a file in Notepad++
  2. Click on the View menu in the menu bar and choose the Word Wrap option on the list.
    Selecting the Word Wrap option in Notepad++
  3. This will adjust the lines according to your Notepad++ window size.

Wrap Lines by Using the Replace Tool

This method can help the users with keeping lines up to limited characters, unlike the above method which keeps the lines equal to the width of the window. By using the replace tool we can easily add a command for numbers of characters to find and replace it with a new line. You don’t need to install plugins for Notepad++ to complete this task when it can be done by existing tools. However, this may not work on the very long tokens like URLs. Follow the below steps to wrap lines:

  1. Double-click on the Notepad++ shortcut to open it. Click on the File menu and choose the Open option. Select your document from the folder and click on the Open button.
    Opening a file in Notepad++
  2. Now click on the Search menu in the menu bar and choose the Replace tool or you can hold Ctrl key and press H button for a shortcut.
    Opening the Replace tool
  3. Type the following command in the Find what section. This tells that the lines should split between 60 and 80 characters.
    ^(.{60,80})\s
  4. Now type the following command in the Replace with section.
    \1\n
  5. Make sure you have selected Regular expression and then click on the Replace All button to wrap lines according to the number of characters you provided.
    Wrapping lines by the number of characters in lines
Tags

Kevin Arrows


Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.
Close