Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>KeepsortedNew to Visual Studio Code? Get it now.
Keepsorted

Keepsorted

Maksym Arutyunyan

|
6 installs
| (0) | Free
Integrates the keepsorted CLI tool
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Keepsorted VS Code Extension

This extension integrates the keepsorted CLI with Visual Studio Code. It formats and checks structured lists so your files stay consistently ordered while comments remain attached to their items.

Requirements

Install the keepsorted command line tool. If you have Rust installed this can be done with:

cargo install keepsorted --version 0.1.7

Prebuilt binaries are also available from the project releases.

Why use it?

  • Keep diffs small and easy to review
  • Maintain consistent ordering without losing comments
  • Quickly fix entire projects or only the sections you select

Commands

  • Keepsorted: Format Selection – sort the selected lines
  • Keepsorted: Format Document – sort the current file
  • Keepsorted: Format Workspace – sort all tracked files in the workspace
  • Keepsorted: Check Selection – check the selected lines for unsorted items
  • Keepsorted: Check Document – check the current file
  • Keepsorted: Check Workspace – check the entire workspace
  • Keepsorted: Show Info – show extension and CLI information
  • Keepsorted: Clear Problems – clear reported diagnostics

Enable Fix on Save or Scan on Open for automatic behaviour via the corresponding settings.

Configuration

Setting Default Description
keepsorted.enable true Enable or disable the extension
keepsorted.fixOnSave false Automatically format a file on save
keepsorted.scanOnOpen false Automatically check a file when opened
keepsorted.openProblems false Open the Problems panel after a scan
keepsorted.path "keepsorted" Path to the CLI executable
keepsorted.extraArgs [] Extra CLI arguments applied to all commands
keepsorted.diffCommand "" Optional custom diff command producing unified diff
keepsorted.verbosity "normal" Amount of output written to the Keepsorted channel

Build and Install

npm ci      # installs dependencies and compiles the extension
npm test
npm run build

The build step creates a .vsix package in the repository root. In VS Code run Extensions: Install from VSIX... and select that file to install the extension locally.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft