Sort selected text in the Atom.
You can select the following items.
Atom Command Palette
-> sort-selected-elements: panel
sort-selected-elements: panel
key. default key is ctrl-shift-alt-s
or
Atom Command Palette
-> sort-selected-elements: sort
sort-selected-elements: sort
key. default key is ctrl-shift-s
sort button
Sort selected elements.sort order selector
Select sort order.
alpah
Alphabetically sort.natural
Natural sort.sort direction
Select sort direction.
asc
Ascending order.descending
Descending order.separator input
Input separator. selected text is separated into elements by this string.case sensitive checker
Indicates whether case sensitive or not.save default button
Save all conditions except lines sort priorities
to default value.load default button
Load all conditions except lines sort priorities
from default value.close button
Close this panel.lines sort checker
Indicates whether perform lines sort or not.lines sort priorities
Input lines sort priorities. Indicates the priority of keys to be sorted. one-based array. negative value means descending order. If it is empty, it will be set to default value when sorting.inline sort checker
Indicate whether perform inline sort or not.unique filter checker
Indicate whether perform unique filter or not. If set it to true, duplicate elements are deleted.no empty filter checker
Indicate whether perform no empty filter or not. If set it to true, empty elements are deleted.Selected text is as below.
009 fox green 350004 cat white 150003 dog gray 200006 cat yellow 200011 rat black 1000010 rat white 1500001 dog white 100007 fox white 300005 cat black 100008 fox black 300012 rat cyan 1250002 dog black 150
Perform sorting with all default values. (lines sort priorities
is emputy)
Then the result is as below.
And lines sort priorities
is set to "1,2,3,4".
001 dog white 100002 dog black 150003 dog gray 200004 cat white 150005 cat black 100006 cat yellow 200007 fox white 300008 fox black 300009 fox green 350010 rat white 1500011 rat black 1000012 rat cyan 1250
This means that sort by the first key, then sort by the second key, and so on.
If you want to sort by only 3rd key, set lines sort priorities
to "3".
Then the result is as below.
Caution: Currently, if you do not specify all the keys, the results may differ.
008 fox black 300005 cat black 100011 rat black 1000002 dog black 150012 rat cyan 1250003 dog gray 200009 fox green 350001 dog white 100004 cat white 150007 fox white 300010 rat white 1500006 cat yellow 200
If set lines sort priorities
to "3,1".
Then the result is as below.
002 dog black 150005 cat black 100008 fox black 300011 rat black 1000012 rat cyan 1250003 dog gray 200009 fox green 350001 dog white 100004 cat white 150007 fox white 300010 rat white 1500006 cat yellow 200
You can determine the direction of each key by specifying a negative number.
For example, if you set lines sort priorities
to "-3,1".
Then the result is as below.
006 cat yellow 200001 dog white 100004 cat white 150007 fox white 300010 rat white 1500009 fox green 350003 dog gray 200012 rat cyan 1250002 dog black 150005 cat black 100008 fox black 300011 rat black 1000
Keystroke | Command | Selector | Description |
---|---|---|---|
ctrl-alt-shift-S | sort-selected-elements:panel | atom-workspace | Open/Close panel. (Activate package) |
ctrl-shift-S | sort-selected-elements:sort | atom-workspace | Sort selected text by default or last conditions. (Activate package) |
none | sort-selected-elements:settings | atom-workspace | Open package settings. (Activate package) |
escape | core:cancel | atom-workspace | Close panel. |
tab | sort-selected-elements:focusNext | sort-selected-elements.root | Focus next. |
shift-tab | sort-selected-elements:focusPrevious | sort-selected-elements.root | Focus previous. |
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.