Sorting in Vim

Sort lines with :sort, and reach for flags like u (unique) or n (numeric) when a plain alphabetical sort is not enough.

Commands you practise

:sort
Sort lines alphabetically with :sort.
:sort{flags}
Reach for flags when plain sorting is not enough: :sort u drops duplicates as it sorts, :sort n compares numbers.

Levels

  1. Heavy Metal Sorting (easy): Sort this messy list of metals alphabetically using a single command.
  2. Double Vision (medium): Deduplicate and sort this list of fruits in one go.
  3. Rank and File (hard): Sort these numbered tasks numerically and remove duplicates.

Each level opens a real Neovim session in your browser with a start file and a target file. Edit one into the other in as few keystrokes as you can, then race the vimbot's solution.

Part of VimGolf.ai Premium ($10 once, lifetime). Region: Find & Replace. See the whole skill map.