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 group of lines separated by blank lines (paragraph, list, or heading section).
When rearranging blocks:
- Headings stay at the top of their section.
- Indented or nested items remain with their parent.
- Sorting/shuffling happens within each level.
- Reversing flips sibling order but keeps children attached.
Blocks are treated as structural units separated by blank lines. Nesting and indentation remain intact.
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.
- Sort headings by width – order by rendered heading width
- Sort headings lexically – alphabetical order by heading text
- Shuffle headings – randomize heading order
- Reverse headings – flip heading order
Subheadings and content remain intact under their parent heading. These commands only affect the selected heading level (shallowest).
- Select the lines or blocks you want to arrange.
-
Open the Command Palette (
Ctrl/Cmd + P) and run a command such as:Sort lines– arranges lines by visual width.
Lexisort lines– alphabetically sorts selected linesReverse lines– reverses line orderSort lines– sorts lines by visual widthShuffle lines– randomizes line order
Lexisort headings– alphabetically sorts top-level headingsReverse headings– reverses heading orderSort headings– sorts headings by visual widthShuffle headings– randomizes heading order
Lexisort blocks– alphabetically sorts text blocksReverse blocks– reverses sibling block orderSort blocks– sorts blocks by visual widthShuffle blocks– randomizes block order
- Open Settings → Community plugins.
- Search for Line Arrange.
- Click Install, then Enable.
- Download the latest release from GitHub Releases.
- Extract into your vault at:
YourVault/.obsidian/plugins/lineArrange- Enable the plugin in Obsidian settings.
- Supports configurable locales for lexical sorting (so A–Z order respects your language/region).
- Works best in source mode or when selections are cleanly separated.
If you find a bug or have a feature request, open an issue on GitHub.
