Replies: 2 comments
|
Personally, I am a fan of Lua since moving to @joelim-work already made a post about possible Lua integration. #2531 |
0 replies
|
Now my branch implemented following features:
And
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I added the ability to load Lua plugin at startup to lf on my fork. You can check it out here: https://github.com/SirZenith/lf/tree/lua.
Wherever a config file is found, the program will look for
pluginsdirectory under parent directory of that config. And each directory underpluginsthat containsinit.luawill be treated as a plugin.lf then load and run those
init.luabefore any config file gets sourced. My current implementation allows Lua plugins to create new commands, register new sorting methods and adds event hook (on-load,on-init...), register file previewer in Lua.Here goes a simple example.
Config directory structure:
Content of `init.lua`
lfrccontent:What makes me want to have Lua plugin support, is I have some really personal requirements for lf to be more happy to use. Requirements being so personal, that I think no body other than me will actually get their hands dirty implementing them, and unlikely to live on as a feature in this repository.
With plugin system, I can do more precise selection that being aware of file status in lf, and make locale-aware sort on file list without walking into cross platform issue and UI flickering.
And user can probably customize the appearance of file list UI in the future, as mentioned in another discussion post.
A known limitation of
gopher-luaruntime that I use, is it can't load C libraries. But still, running Lua scripts alone can already do many things.So what do you guys think? Would you want lf to have plugin support? Would you be willing to maintain such feature?
All reactions