Some plug-in interface requests #470
Replies: 5 comments
-
Thank you for summarizing this.
You can obtain the list of files in the current area using It returns an array where each element is a file object. You can retrieve the file's icon using yazi/yazi-plugin/src/bindings/file.rs Lines 15 to 24 in cf769bf And: yazi/yazi-fm/src/lives/folder.rs Lines 47 to 156 in cf769bf
You can directly override the local old_icon_method = Folder.icon
function Folder:icon(file)
if my_plugin.some_key_pressed then
return ui.Span("this is my custom icon")
else
return old_icon_method(self)
end
end
We can add a dedicated command for it. Currently, you can only combine two commands, ya.manager_emit("arrow", { "5" })
ya.manager_emit("select", { state="true" }) It will select the fifth file.
We can also add it. |
Beta Was this translation helpful? Give feedback.
-
First of all, thank you very much for your patient answer, I believe we can make yazi better together. |
Beta Was this translation helpful? Give feedback.
-
I'll test the existing api first, and if you have the time, thank you very much for adding the last api. |
Beta Was this translation helpful? Give feedback.
-
2024-01-04.21-00-25.mp4hey,I think I have completed the testing of the previous interfaces. What should I do to bind my feature switch function in keymap.toml? just like triggering linemo. |
Beta Was this translation helpful? Give feedback.
-
I can only manually change init.lua to statically start and shut down, I need a dynamic way to enable and shut down by key commands like other feature. |
Beta Was this translation helpful? Give feedback.
-
hey, I want to implement a label jump plugin, and now I need these interfaces, are there any ready-made lua interfaces now?
@sxyazi
Beta Was this translation helpful? Give feedback.
All reactions