Sort Lines

unlisted

by Mark Ayers (originally by Vinzent)

Sort and permute lines, lists, and headings

Updated 1mo agoMIT
View on GitHub

Sort Lines

Sort and permute lines, lists, and headings in Obsidian. Originally created by Vinzent.

You probably shouldn't install this

This is personal tooling, not a general-purpose plugin. It is opinionated in ways that only make sense for one person's workflow:

  • Single user. The only known installation is the maintainer's. Breaking changes ship without migration paths (see CHANGELOG.md — 2.0.0 removed five commands including checkbox-aware sorts and flat-list sort, changed heading sort to pure alphabetical).
  • Fork, not upstream. This diverged from Vinzent03/obsidian-sort-and-permute-lines and is not a drop-in replacement. Commands were removed, sort behavior changed, and internals restructured.
  • No issue triage for feature requests. Bugs are welcome; feature requests from other users will almost always be closed as out-of-scope.

If you want something similar, the code is MIT-licensed — fork it and adapt. Don't expect upstream to accommodate your workflow.

Commands

CommandBehavior
Sort alphabeticallySort selected lines (or whole file) alphabetically using Intl.Collator
Sort by lengthSort selected lines by character count
Sort headingsRecursively sort heading sections alphabetically at each level
ReverseReverse the order of selected lines
ShuffleRandomly reorder selected lines (Fisher-Yates)
Sort list recursivelySort the enclosing list and all nested sublists alphabetically

All commands operate on the current selection. If nothing is selected, the whole file is used (excluding frontmatter). List commands operate on the enclosing list at the cursor.

Alternatives

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.