Yazi plugin to preview directories using eza, can be switched between list and tree modes.
ya pack -a ahkohd/eza-preview
Add eza-preview
to previewers in yazi.toml
:
[[plugin.prepend_previewers]]
name = "*/"
run = "eza-preview"
Set key binding to switch between list and tree modes in keymap.toml
:
[manager]
prepend_keymap = [
{ on = [ "E" ], run = "plugin eza-preview", desc = "Toggle tree/list dir preview" },
{ on = [ "-" ], run = "plugin eza-preview --args='--inc-level'", desc = "Increment tree level" },
{ on = [ "_" ], run = "plugin eza-preview --args='--dec-level'", desc = "Decrement tree level" },
{ on = [ "$" ], run = "plugin eza-preview --args='--toggle-follow-symlinks'", desc = "Toggle tree follow symlinks" },
]
List mode is the default, if you want to have tree mode instead when starting yazi - update init.lua
with:
require("eza-preview"):setup({
-- Determines the directory depth level to tree preview (default: 3)
level = 3,
-- Whether to follow symlinks when previewing directories (default: false)
follow_symlinks = false
-- Whether to show target file info instead of symlink info (default: false)
dereference = false
})
-- Or use default settings with empty table
require("eza-preview"):setup({})