feat(yazi): add some more plugins to yazi.

This commit is contained in:
CronyAkatsuki 2025-11-05 19:28:54 +01:00
parent 71095292e9
commit 6ef00fe663
3 changed files with 177 additions and 11 deletions

View file

@ -0,0 +1,43 @@
-- Hide preview pane by default
require("toggle-pane"):entry("min-preview")
-- Have nice rounded border
require("full-border"):setup({
type = ui.Border.ROUNDED,
})
-- Smartly enter directory or open file
require("smart-enter"):setup({
open_multi = true,
})
-- Setup some folder rules
require("folder-rules"):setup()
-- Show git status of files
require("git"):setup()
-- Show symlink in status bar
Status:children_add(function(self)
local h = self._current.hovered
if h and h.link_to then
return " -> " .. tostring(h.link_to)
else
return ""
end
end, 3300, Status.LEFT)
-- Show user/group of file in status bar
Status:children_add(function()
local h = cx.active.current.hovered
if not h or ya.target_family() ~= "unix" then
return ""
end
return ui.Line {
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
":",
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
" ",
}
end, 500, Status.RIGHT)