Skip to content

[Feature request] An option to join lines for whole file, respecting paragraph breaks, like nano's Justify #708

@nevillepark

Description

@nevillepark

The venerable terminal-based text editor nano has a command called "justify" (Ctrl+J) that joins all lines in a paragraph, or in marked (selected) text, wrapping the text to fill a certain length of characters. If you set the fill length to a very high number (like 100000) each paragraph becomes one long line, without wrapping, like xed's "join lines" command (also Ctrl+J).

However, nano also has a shortcut, Alt+J, to justify the entire file at once, keeping paragraph breaks (either a blank line between lines of text, or optionally an indent at the beginning of a line). This is very handy if, for example, you are reformatting text wrapped to a short line length but still want to keep the paragraph breaks. (Often the case with text copied and pasted from a PDF.) It would be nice if xed had something similar.

Currently, when you select text and press Ctrl+J, xed will get rid of blank lines/paragraph breaks:

A document open in xed, with two short lines of text, a blank line, and two more short lines. All the text on one line.

Whereas in nano this is what Alt+J does:

The same text entered in nano. The first two lines are joined into one, then a paragraph break, then the second two lines joined into one.

This is basically the one thing that keeps nano in my workflow. It's just a "nice to have", but I wish xed had something similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions