Text paragraph (re)formatting (and justification): how do it?
-
Many years ago I used a lot MultiEdit, which had a very convenient feature for paragraph reformatting, where at the press of key combination it reformatted the paragraph of text for line breaking at the right limit you set (say at column 80), and following the indentation at the beginning of paragraph.
That’s very useful when editing long plain text, or long comments.Is there anything like that in a plug-in?
The setting for Preferences/Editing/Vertical Edge is just visual? -
Yes, the vertical edge is just a visual cue.
If you only care about seeing long lines on the screen (as opposed to actually inserting newlines into the file), you can turn on the word wrap feature: View->Word wrap.
-
@Jim-Dailey oh well, I actually wanted to reformat text while typing, not just having the visual word wrap (that anyway fits line continuation to window’s width).
Let’s see if anyone’s eager to add these features in a plug-in, I don’t think I’d have time to write one myself right now :) -
@Luca-Matteini said in Text paragraph (re)formatting (and justification): how do it?:
Many years ago I used a lot MultiEdit, which had a very convenient feature for paragraph reformatting, where at the press of key combination it reformatted the paragraph of text for line breaking at the right limit you set (say at column 80), and following the indentation at the beginning of paragraph.
That’s very useful when editing long plain text, or long comments.Is there anything like that in a plug-in?
The setting for Preferences/Editing/Vertical Edge is just visual?There is a way to do that in Notepad++, but it’s not a one-key command.
First, choose a right margin where paragraphs should wrap. Using the menubar, go to “Settings > Preferences > Margins/Border/Edge > Vertical Edge Settings”. Enter a positive integer and click “Close”. You should see a thin vertical line on screen after doing this.
Next, assuming that paragraphs will be separated by blank lines, navigate to a excessively long line to be reformatted (i.e., converted to a wrapped paragraph). Move the cursor into the line so the line is highlighted. Type Control-I (menu: “Edit > Line Operations > Split line”). This will split the line into a multiple lines at the right-margin setting.
Otherwise, find a paragraph (a block of 2 or more contiguous lines) to reformat. Reformatting is a 3-step process which can be done very quickly.
(1) Using the mouse, triple-click the top line of the paragraph. This marks the entire line.
(2) Hold down the shift key and move the mouse to the end of the last line of the paragraph. Left-click again. This marks the entire paragraph as a block.
(3) Type Control-J, Control-I (menu: “Edit > Line Operations > Join lines” followed immediately by “Split lines”). This will unformat and reformat the paragraph.
Maybe somebody here knows how to convert this into a macro.
-
@Eric-Pement said in Text paragraph (re)formatting (and justification): how do it?:
There is a way to do that in Notepad++, but it’s not a one-key command.
In 2025, yes.
But, in defense of the original answers: In 2016, when the question was asked, that feature didn’t yet exist.
But, yes, that definitely works now, so thanks for sharing the sequence.
-
Some related discussions, in these topics: