A VS Code extension that sorts and removes duplicate lines instantly. Select specific lines or leave unselected to process the entire file, then press Alt+W.
Install from VS Code Marketplace
Or search "Sort & Unique Lines" in the Extensions view (Ctrl+Shift+X).
Download the .vsix file from releases, then:
code --install-extension sort-unique-lines-1.1.2.vsixgit clone https://github.com/LabinatorSolutions/sort-unique-lines.git
cd sort-unique-lines
bun install
bun run compile
bun run package
code --install-extension sort-unique-lines-*.vsix- Select lines in any editor (or select nothing to process the entire file)
- Press
Alt+W - The selection is replaced with sorted, deduplicated lines
- Undo with
Ctrl+Zas usual
- Sorts lines ascending or descending
- Removes duplicate lines (case-insensitive dedup by default)
- Trims leading/trailing whitespace (configurable)
- Strips blank lines (configurable)
- Case-sensitive mode available
- Works on selection or the entire file
- Zero runtime dependencies
All settings live under File > Preferences > Settings → search "Sort & Unique Lines".
| Setting | Type | Default | Description |
|---|---|---|---|
sort-unique-lines.sortOrder |
"ascending" | "descending" |
"ascending" |
Sort direction |
sort-unique-lines.caseSensitive |
boolean |
false |
Treat uppercase/lowercase as different |
sort-unique-lines.removeBlankLines |
boolean |
true |
Strip empty and whitespace-only lines |
sort-unique-lines.trimLines |
boolean |
true |
Trim whitespace from each line before sorting |
Default: Alt+W
Change it in File > Preferences > Keyboard Shortcuts → search "Sort & Unique Lines".
bun install # install dependencies
bun run compile # compile TypeScript → out/
bun test # run unit tests
bun run lint # lint with Biome
bun run format # format with Biome
bun run package # build .vsixRequires Bun and VS Code 1.125+.
Built with Bun + TypeScript + Biome. Zero runtime dependencies.
Built by Labinator.
Powered by Bun, TypeScript, and Biome.