Custom Line Sort icon

Custom Line Sort

A highly customizable line-sorting extension for VSCodium and Visual Studio Code (VS Code).

Open VSX Marketplace Version MIT License

Custom Line Sort gives you the usual line-sorting commands, but without forcing every possible sorting variant into your Command Palette. Choose which sort commands you actually want to use, hide the rest, and customize how certain sorting modes behave.

Features

Why Custom Line Sort?

There are already many line-sorting extensions. Custom Line Sort focuses on giving you control over the sorting experience itself.

Instead of installing an extension that adds a fixed collection of commands, you decide which sorting operations should be available. For sort modes with configurable behavior, you can also adjust how the comparison is performed.

The result is a line sorter that can be as simple or as specialized as you want it to be.

Commands

Run Custom Line Sort commands from the Command Palette. The commands that appear depend on which sorting operations you enable in Settings.

Sorting algorithms

The built-in sort in VSCodium and VS Code behaves like "Lexicographically, Case Insensitive", except when two lines differ only in letter case. In that situation, it applies the "Lexicographically" ordering in reverse: lowercase letters come before uppercase letters, whereas the lexicographical algorithm places uppercase letters first.

See sorting samples for a side-by-side comparison of the results.

Settings

Use the Enabled Sort Modes setting to choose which sorting commands appear in the Command Palette. All commands are enabled by default. You can also customize the behavior of supported sort modes.

Line-length sorting has a primary and a secondary fallback. The primary fallback can compare word lengths from either end, with shorter or longer words first, or skip directly to the secondary fallback. The secondary fallback can retain relative order or sort lexicographically or naturally, with optional case-insensitive comparison.

Natural sorting compares digit sequences by numeric value, so value2 appears before value10.

Compatibility

Custom Line Sort is compatible with VSCodium and Visual Studio Code (VS Code).

Download

Download the extension from

See the release history.

Request a feature

If you would like to have a different sort algorithm implemented, just let me know. Ideally, open a feature request on Codeberg to track progress, or contact me directly at hjaqu83g0@mozmail.com.

Development

See the development instructions.

License

MIT, see LICENSE.

My other projects

See also my other projects.