Skip to content
Visual Studio Code extension to sort lines of text
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
fixtures
images
src
.editorconfig
.gitignore
.travis.yml
.vscodeignore
CHANGELOG.md
LICENSE
README.md
jsconfig.json
package.json
tsconfig.json
tslint.json

README.md

Build Status

Functionality

Sort lines of text in Visual Studio Code. The following types of sorting are supported:

Command Title Comments
sortLines.sortLines Sort lines (ascending, case sensitive) Keybound to F9*
sortLines.sortLinesCaseInsensitive Sort lines (ascending, case insensitive)
sortLines.sortLinesCaseInsensitiveUnique Sort lines (unique ascending, case insensitive)
sortLines.sortLinesReverse Sort lines (descending, case sensitive) Reverse character code based sort
sortLines.sortLinesLineLength Sort lines (line length ascending)
sortLines.sortLinesLineLengthReverse Sort lines (line length descending)
sortLines.sortLinesVariableLength Sort lines (variable length ascending)
sortLines.sortLinesVariableLengthReverse Sort lines (variable length descending)
sortLines.sortLinesNatural Sort lines (natural) Sorts alphabetically but groups multi-digit numbers (Wikipedia)
sortLines.sortLinesUnique Sort lines (unique ascending, case sensitive) Regular character code keeping only unique items
sortLines.sortLinesShuffle Sort lines (shuffle)

* Note that this overrides the toggle breakpoint keybinding, you can unbind it by adding this to your keybindings.json file:

`{ "key": "f9", "command": "-sortLines.sortLines", "when": "editorTextFocus" }`

Settings

Name Description Default
sortLines.filterBlankLines (boolean) Filter out blank (empty or whitespace-only) lines. false
sortLines.sortEntireFile (boolean) Sort entire file if no selection is active. false

Install

  1. Open VS Code
  2. Press F1
  3. Type "install"
  4. Select "Extensions: Install Extension".
  5. Select sort-lines from the list

Install animation

Usage

Select the lines to sort, press F1 type sort and select the desired sort. The regular sort has the default hotkey F9.

Usage animation

You can’t perform that action at this time.