Manual sorting refers to being able to control the display order of files and folders arbitrarily. Although for most purposes the automatic sorting methods (e.g. sorting files alphabetically by name) are all you need, many people have use cases where being able to control the sort order exactly would be useful.
Manual sort mode needs to be activated in a Lister before files can be arbitrarily arranged. To activate manual sorting, use the Set MANUALSORT command, or turn on the Sorting Options / Manual sorting option on the Display tab in the Folder Options dialog. Obviously as a folder options setting, this mode can also be made permanent by saving the folder format.
If a manual sort order had previously been defined (and saved) for the current folder, the file list will resort automatically when manual sorting is turned on. Otherwise, turning on manual sorting will have no immediate effect on the file list.
In details or power mode, or when the column header is enabled in the other modes, a new button ( ) appears on the left of the column header when in manual sort mode. Clicking this button displays a control menu with a few commands in it relating to manual sort mode:
Once manual sort mode is active, you can reposition a file using drag-and-drop, or from the keyboard using Shift + Alt in conjunction with the cursor keys.
By default, your manual sort order will be persistent (saved automatically), whenever possible (see below for current limitations on manual sorting). If you want the freedom to change the sort order temporarily without making it permanent, you can turn off the Folders / Folder Behaviour / Automatically save manual sort order where possible option in Preferences. With that option turned off, you need to use the Save Sort Order command in the control menu, or the Set MANUALSORTSAVE command, to save the current sort order permanently.
At any time, you can reset the sort order to the current automatic order (e.g. alphabetical by name) using the Reset Sort Order command in the control menu (shown above), or with the Set MANUALSORTRESET command.
By default you’re limited to just a single manual sort order per folder (one manual sort order ought to be enough for anyone!) but if you need to be able to define more than one, you can add “named orders” through the Miscellaneous / Advanced / manual_sort_names option in Preferences.
When named orders are defined they appear in the column header’s control menu, letting you switch between them at will.
The Folder Options dialog also displays a drop-down (on the Display tab) showing all the named sort orders, which lets you select the default for a folder if desired. The Set MANUALSORT command also lets you specify the named order to switch to a particular sort from a command.
The Format script object provides the following properties relating to manual sorting:
manual_sort: Returns True if manual sorting is active.
manual_sort_name: The name of the current manual sort (or empty if the sort order is not named).
manual_sort_order: Returns a SortOrder object that allows the current sort order to be queried and modified.
The SortOrder object returned by the manual_sort_order property has the following methods:
GetOrder: Returns a Vector of strings representing the current sort order of the folder. An optional parameter lets you specify a particular named sort.
SetOrder: Accepts a Vector of strings representing the desired sort order of the folder.
ResetOrder: Resets the current sort order of the folder to the default. An optional parameter lets you specify a particular named sort.
Currently manual sort orders can’t be saved for some types of folders:
Non-NTFS disk folders (e.g. FAT/FAT32)
Archives
FTP
By default, manual sorting is disabled completely in folders that the order can’t be saved for. If you turn on the Folders / Folder Behaviour / Allow manual sorting in all folders Preferences option then manual sorting will be available everywhere, but changes to the sort order in those types of folders will only be temporary.
Manual sorting is currently not supported in Flat View or when the file display is grouped. It will also not work correctly in a folder when compatibility files are displayed and there are two files with the same name.