Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

up vote 10 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
1  
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
2  
+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

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
  • DON'T CHANGE THE WINDOW SIZE
  • 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.