chitwan276k downloadsShuffle, reverse, or sort lines, using either visual width or lexical order.
Line Arrange is an Obsidian plugin that lets you rearrange lines, blocks, or headings in different ways: sorting, reversing, and shuffling. Sorting can be done alphabetically or by visual width (how wide the text looks on screen).
Operate on a flat selection of lines. Hierarchy is ignored; each line is treated individually.
Sort lines by width – order by rendered text width
Sort lines lexically – order alphabetically (A → Z)
Shuffle lines – randomize order
Reverse lines – flip order top-to-bottom

Operate on paragraphs, lists, or sections. Block hierarchy (headings, indentation) is preserved.
Sort blocks by width – order blocks by their widest line
Sort blocks lexically – alphabetical order by first line of block
Shuffle blocks – randomize block order while keeping sub-blocks grouped
Reverse blocks – flip sibling blocks while preserving nesting

A block = a top-level line together with all its indented children.
When rearranging blocks:
Blocks are treated as hierarchical units defined by indentation. The tree structure is preserved — only sibling order changes.
Limitations: Complex elements (horizontal rules, tables, code blocks, deeply nested structures) may not behave as expected.
Operate only on top-level headings in your selection. The heading itself determines the order; everything beneath each heading (subheadings, paragraphs, lists) stays attached.
Subheadings and content remain intact under their parent heading. These commands only affect the selected heading level (shallowest).
Ctrl/Cmd + P)Open the command palette and run a command such as:
Sort lines – arranges lines by visual width.
You can also right-click the editor and choose:
Line Arrange >
Then select the desired operation.
Lexisort lines – alphabetically sorts selected linesReverse lines – reverses line orderSort lines – sorts lines by visual widthShuffle lines – randomizes line orderLexisort headings – alphabetically sorts top-level headingsReverse headings – reverses heading orderSort headings – sorts headings by visual widthShuffle headings – randomizes heading orderLexisort blocks – alphabetically sorts text blocksReverse blocks – reverses sibling block orderSort blocks – sorts blocks by visual widthShuffle blocks – randomizes block orderYourVault/.obsidian/plugins/lineArrange
If you find a bug or have a feature request, open an issue on GitHub.