Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I reformat a paragraph in Notepad++?

In UltraEdit I can select one or more long lines and reformat the paragraph to the set right margin (e.g. 60 or 80) by menu command Format/Reformat Paragraph, keyboard shortcut Ctrl + T. Note that it is hard formatting (inserting line ends), not how the document is displayed in the editor.

How can the equivalent be done in Notepad++?

share|improve this question
up vote 16 down vote accepted

It's sort of weird.

If you just want to wrap a paragraph at 72 characters you can just go to TextFX>TextFX Edit>ReWrap Text to (Clipboard or 72) width. Which will re-wrap your selected text to 72 characters.

If you want a 61 or 87 character wrap however, you need to copy the text "61" into your clipboard and then do the same thing (TextFX>TextFX Edit>ReWrap Text to (Clipboardor 72) width).

I'm sure Don HO would be interested in a patch for some TextFX Reformat Paragraph stuff, if you were so inclined.

share|improve this answer
The clipboard thing is impractical as I am constantly using this feature, but the hardcoded value of 72 is probably acceptable. I will see if I can figure out how to attach a keyboard shortcut to the ReWrap command. – Peter Mortensen Jan 24 '10 at 23:55
Good-However. It will 'join' my lines together. It does not respect the new-lines I have manually inserted. – Felipe Alvarez Sep 17 '10 at 11:12
This doesn't preserve indentation, either – endolith Oct 16 '12 at 15:44

This can now be done (at least in v5.9.8) via the combination of some commands in the Edit menu. Edit > Line Operations > Split Lines will insert a hard wrap at the width of the window. The hotkey for this is Ctrl-I. Edit > Line Operations > Join Line will join lines and has a hotkey of Ctrl-J.

So for a paragraph on one line, if you want to wrap at 60 or 80, resize your window to 60 or 80 characters wide, select the line you would like to hard-wrap, and hit Ctrl-I.

Alternatively, if your paragraph was already formatted to a different width, select all the lines of the paragraph and hit Ctrl-J. Then follow the aforementioned steps and you'll have a newly formatted paragraph!

share|improve this answer
This doesn't preserve indentation of the first line, though. – endolith Oct 16 '12 at 15:45
+1 for solution not involving additional plugins – Benny Dec 28 '12 at 3:51
this doesn't preserve functional formatting either, eg textbf{beup} isn't considered as one word :( – Gunther Struyf May 20 '13 at 10:03

To put it all together, go to Settings > Preferences > Editing > Show Vertical Edge, and check it. If you don't actually want to see the border, select "Background Mode". Then set your column width by clicking the number after Number of Columns.

Select your text, then hit Ctrl-J (i.e. Join Lines), Ctrl-I (Split Lines).

share|improve this answer

Try Settings > Preferences > Editing > Show Vertical Edge

share|improve this answer

Pro-tip if you're looking to wrap by comma/delimiter (based on the answer by Michael Herold above):

  • Use a macro to separate each symbol into a new line
  • e.g. Home, Ctrl+Right, Right, Enter, for comma-delimited entries
  • then Play back the macro N times
  • Select all
  • Size your window to the desired column width (Settings -> Preferences -> Editing -> Number of Columns, and on the same page Show Verical Edge)
  • Ctrl+J
  • Select all
  • Ctrl+I

This trick will size by e.g. comma delimiter, whereas just using Ctrl+I will not, very useful if you have e.g. 1000+ such lines.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .