Page 1 of 1

Customized sorting of files/folders in panel

Posted: Sun 16 Feb, 2014 16:31
by ragimiri
I assume, that FAR does not support this feature. It would be nice to have customized sorting rules of files/folders in panel. E. g. in Czech languge letter CH is between H and I, but FAR is positioning files/folder beginning with CH between C and D.

Correct sorting in Czech: Adolf, Benedikt, Cyril, Dalibor, Erik, Filip, Gustav, Havel, Chajim, Igor

Incorrect sorting by FAR: Adolf, Benedikt, Chajim, Cyril, Dalibor, Erik, Filip, Gustav, Havel, Igor

Re: Customized sorting of files/folders in panel

Posted: Sun 16 Feb, 2014 16:46
by Shmuel
Far does support custom sorting in panels. See Encyclopedia\macroapi_manual.en.chm (search for LoadCustomSortMode).

Trim x characters on panel from left

Posted: Thu 10 Jul, 2014 10:34
by KtW
Hi all,

I was searching for a method to trim 15 character and hide them from the file name column on far manager panel.

For example I've these folders in a directory:
I need to order these folders by "Name" by excluding the first 15 charatcters that compose the folder name
so the displayed content on "Name" column will display like this without the date - an so can be ordered
corectly by name:

Can be achieved a function like this? In panel layout configuration i've not found a "hide frist x char" modifier to use...

Thanks in advance...
Later
KtW

Posted: Thu 10 Jul, 2014 11:20
by HaRT
KtW
Please see custom sorting above.

Re: Trim x characters on panel from left

Posted: Thu 10 Jul, 2014 14:43
by Shmuel
KtW wrote:Can be achieved a function like this? In panel layout configuration i've not found a "hide frist x char" modifier to use...
As far as I know, there's no option to hide some characters from being displayed.
If all you need is sorting panel entries according to your arbitrary criteria, then it can be achieved, though not easy: one is expected to know LuaJIT FFI programming.

Attached is an example of such custom sorting, corresponding to your criteria (as I understand it). Unpack this file to your %farprofile%\Macros\scripts folder and restart Far. Then pressing CtrlShiftF3 will invoke that sorting.
CustomSortExample.7z
(762 Bytes) Downloaded 380 times

Re: Customized sorting of files/folders in panel

Posted: Thu 10 Jul, 2014 18:43
by KtW
:bojan:

Thanks Shmuel! I'm so happy!

Your script worked like a charm for me with offset 13!

Alone I would not have ever made! :oops: