A plugin utilizing FZF to change directory needs help
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 4
- Joined: 2020-10-30, 14:22 UTC
A plugin utilizing FZF to change directory needs help
I am developing a plugin for fast directory changing, it will use the well known fuzzy finder - fzf to match the path history.
Once the path is selected, it will notify TC to make source panel jump in the new path:
Image: https://skywind3000.github.io/images/p/misc/wx20201030223252.png
It will be an efficient way to access most recently accessed pathes.
But it appears that there is no way for me to retrive path history in TC.
Is there a way that TC can provide a hook, and call it everytime path changing happens in the left/right panel ?
The hook can be either a TC user defined command or external program. If so, I can record the latest path in a local database.
I have noticed that there are "[lefthistory]" and "[righthistory]" in the wincmd.ini, but both of them do not update in realtime.
So the plugin has no chance to read the new path in time.
So, my question is, is it possible to call a command (or an external program) every time the source/target path changes ?
or update "[lefthistory]" and "[lefthistory]" section everytime when they changed ?
Or any way to get the path history in realtime ?
Once the path is selected, it will notify TC to make source panel jump in the new path:
Image: https://skywind3000.github.io/images/p/misc/wx20201030223252.png
It will be an efficient way to access most recently accessed pathes.
But it appears that there is no way for me to retrive path history in TC.
Is there a way that TC can provide a hook, and call it everytime path changing happens in the left/right panel ?
The hook can be either a TC user defined command or external program. If so, I can record the latest path in a local database.
I have noticed that there are "[lefthistory]" and "[righthistory]" in the wincmd.ini, but both of them do not update in realtime.
So the plugin has no chance to read the new path in time.
So, my question is, is it possible to call a command (or an external program) every time the source/target path changes ?
or update "[lefthistory]" and "[lefthistory]" section everytime when they changed ?
Or any way to get the path history in realtime ?
Re: A plugin utilizing FZF to change directory needs help
Old xcd was already working with fuzzy search a bit like agrep search on top of complete wc tree file
You have a TC command to save config history ( cm_ConfigSaveDirHistory 582 ) and one to save all ( cm_ConfigSaveSettings 580). So you do not need any hook to get notified at each foler change (Specially because TC do not remember all path but only the ones where you stay a little).
So my advise is more to call TC to save history when you want to use your companion plugin/soft.
If you send message with copy data to total commander current instance you can change folder as you want or just call TC with parameter if single instance is set.
I personally use a modified version of SpeedDial command line using EVerything see on VoidTools forum. And still use XCD on a large bookmark file.
You have a TC command to save config history ( cm_ConfigSaveDirHistory 582 ) and one to save all ( cm_ConfigSaveSettings 580). So you do not need any hook to get notified at each foler change (Specially because TC do not remember all path but only the ones where you stay a little).
So my advise is more to call TC to save history when you want to use your companion plugin/soft.
If you send message with copy data to total commander current instance you can change folder as you want or just call TC with parameter if single instance is set.
I personally use a modified version of SpeedDial command line using EVerything see on VoidTools forum. And still use XCD on a large bookmark file.
Re: A plugin utilizing FZF to change directory needs help
I don't see any big advantage of such a plugin.
Using Everything and JumpToFolder or Everything Toolbar
its so easy and fast to jump to any file or folder in TC
so the normal history is enough.
Using Everything and JumpToFolder or Everything Toolbar
its so easy and fast to jump to any file or folder in TC
so the normal history is enough.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
-
- Junior Member
- Posts: 4
- Joined: 2020-10-30, 14:22 UTC
Re: A plugin utilizing FZF to change directory needs help
@Horst.Epp, the idea is inspired by z.sh: https://github.com/rupa/z
And when I use it to search directories, it always suggests many useless directories
which I will never enter.
So I decide to track the directory changing and sort them by frecency, which means
directories with higher frecency always come first.
Both autojump and z.sh are well known command line productivity tool, their idea
could make path changing faster in TC.
Everything always take a long time to warm up the database each time it starts.Frecency:
Frecency is a portmanteau of 'recent' and 'frequency'. It is a weighted
rank that depends on how often and how recently something occurred. As
far as I know, Mozilla came up with the term.
To z, a directory that has low ranking but has been accessed recently
will quickly have higher rank than a directory accessed frequently a
long time ago.
Frecency is determined at runtime.
And when I use it to search directories, it always suggests many useless directories
which I will never enter.
So I decide to track the directory changing and sort them by frecency, which means
directories with higher frecency always come first.
Both autojump and z.sh are well known command line productivity tool, their idea
could make path changing faster in TC.
Re: A plugin utilizing FZF to change directory needs help
Everything running in the background together with its service as suggestedskywind3000 wrote: 2020-10-30, 17:26 UTC @Horst.Epp, the idea is inspired by z.sh: https://github.com/rupa/z
...
Everything always take a long time to warm up the database each time it starts.
And when I use it to search directories, it always suggests many useless directories
which I will never enter.
So I decide to track the directory changing and sort them by frecency, which means
directories with higher frecency always come first.
Both autojump and z.sh are well known command line productivity tool, their idea
could make path changing faster in TC.
always delivers results in seconds for me.
You can also enter simple words to narrow the results.
In JumpToFolder you can even use the Run count as sort order to get most used entries first.
Also this way I go to any file or folder fast and not only to the ones I visited in the past.
I guess you are not very familar with Everything and the related AHK tools.

Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: A plugin utilizing FZF to change directory needs help
Support ++
Post by horst.epp » Thu Oct 29, 2020 10:47 am in voidtools forum
One more suggestion for your context menu: of JumpToFolder
Add a context menu item like "Open Special".
This should allow to select once any tool which in the future will be started with the entry as parameter.
This way I could directly jump to any entry (Folder or File) in Total Commander without additional steps.
Currently I use the Copy to clipboard and later jump to the clipboard content in Total Commander.
This would also work with many other file managers.
Best implementation would be to also allow additional parameters for the tool definition.
This would allow calling explorer like
Explorer.exe /select,"%1"
Post by horst.epp » Thu Oct 29, 2020 10:47 am in voidtools forum
One more suggestion for your context menu: of JumpToFolder
Add a context menu item like "Open Special".
This should allow to select once any tool which in the future will be started with the entry as parameter.
This way I could directly jump to any entry (Folder or File) in Total Commander without additional steps.
Currently I use the Copy to clipboard and later jump to the clipboard content in Total Commander.
This would also work with many other file managers.
Best implementation would be to also allow additional parameters for the tool definition.
This would allow calling explorer like
Explorer.exe /select,"%1"
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
-
- Junior Member
- Posts: 4
- Joined: 2020-10-30, 14:22 UTC
Re: A plugin utilizing FZF to change directory needs help
@nsp, thanks for your help, my addon released:nsp wrote: 2020-10-30, 15:53 UTC Old xcd was already working with fuzzy search a bit like agrep search on top of complete wc tree file
You have a TC command to save config history ( cm_ConfigSaveDirHistory 582 ) and one to save all ( cm_ConfigSaveSettings 580). So you do not need any hook to get notified at each foler change (Specially because TC do not remember all path but only the ones where you stay a little).
So my advise is more to call TC to save history when you want to use your companion plugin/soft.
If you send message with copy data to total commander current instance you can change folder as you want or just call TC with parameter if single instance is set.
I personally use a modified version of SpeedDial command line using EVerything see on VoidTools forum. And still use XCD on a large bookmark file.
https://github.com/skywind3000/tcz_cd
It will follow the most recently accessed rules and can be more efficient than "Everything".