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
May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 1 | 0 | 1 | 2 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 2 | 1 | 0 | 0 | 0 | 4 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 0 | 1 | 1 | 1 | 2 | 2 | 1 | 1 | 1 | 1 | 0 | 2 | 0 | 0 | 0 | 3 | 2 | 0 | 1 |
Mac | 0 | 0 | 0 | 2 | 3 | 3 | 1 | 0 | 1 | 0 | 1 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 3 | 1 | 0 | 1 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 | 1 | 0 | 1 | 1 | 0 | 2 |
Linux | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 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