Sort Lines (Numerically)
Sublime Text 2/3 package that adds a command for sorting lines numerically rather than alphabetically.
Details
Installs
- Total 10K
- Win 4K
- Mac 4K
- Linux 2K
| Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 4 | 0 | 0 | 1 | 1 | 0 | 0 | 4 | 0 | 1 | 0 | 4 | 1 | 1 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 2 | 0 | 2 | 0 | 0 | 2 |
| Mac | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 0 | 0 | 4 | 2 | 2 | 6 | 0 | 0 | 0 | 0 | 2 | 3 | 2 | 1 | 1 | 1 | 2 | 0 | 0 | 0 | 2 | 2 | 2 | 1 | 1 | 4 | 1 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sort Lines (Numerically)
Sublime Text 2/3 package that adds a command for sorting lines numerically rather than alphabetically.
Installation
This package is available through Package Control, it’s called “Sort Lines (Numerically)”.
Usage
Just run “Sort Lines (Numerically)” from the Command Palette, or from the Edit menu, which has a keyboard shortcut as well.
Adding a reverse command
This package does not have a reverse option when sorting, since there is already a Reverse command built into Sublime Text. If you want a shortcut for sorting numerically in reverse, you can make one yourself:
In your User package folder, create a file called Sort Lines (Numerically) Reverse.sublime-macro. Edit that file, paste in the following, and save:
[
{
"args": null,
"command": "sort_numerically"
},
{
"args": {
"operation": "reverse"
},
"command": "permute_lines"
}
]
There will now be a new menu item at Tools > Macros > User > Sort Lines (Numerically) Reverse that when selected will sort numerically and reverse the order. If you want this macro available in the command palette, create a file in your User folder called something like SortLinesNumericallyReverse.sublime-commands containing the following:
[
{
"caption": "Sort Lines (Numerically) Reverse",
"command": "run_macro_file",
"args": {
"file": "Packages/User/Sort Lines (Numerically) Reverse.sublime-macro"
}
}
]
You will now have a command called Sort Lines (Numerically) Reverse in your command palette. If you want to bind this command to a keyboard shortcut, add something like the following to your default user keymap file (available at Preferences > Key Bindings – User:
{
"keys": ["ctrl+shift+f5"],
"command": "run_macro_file",
"args": {
"file": "Packages/User/Sort Lines (Numerically) Reverse.sublime-macro"
}
}
Credits
Thanks to the following contributors:
- Curtis Gibby – @curtisgibby
- David Jack Wange Olrik – @davidolrik
- Frank Tan – @tansongyang