{ inputs, ... }: { programs.yazi = { enable = true; enableFishIntegration = true; package = inputs.yazi.packages.x86_64-linux.default; initLua = ../../homes/emenel/dotfiles/dot_config/yazi/init.lua; keymap = { manager.prepend_keymap = [ { on = ["c" "d"]; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; desc = "drag selection";} { on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; } { on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; desc = "go to top of git repo"; } { on = ["t" "p"]; run = "plugin toggle-view parent"; desc = "Toggle parent"; } { on = ["t" "c"]; run = "plugin toggle-view current"; desc = "Toggle current"; } { on = ["t" "r"]; run = "plugin toggle-view preview"; desc = "Toggle preview"; } { on = ""; run ="tab_create"; } { on = ""; run ="tab_close"; } { on = ""; run ="tab_switch 1 --relative"; } { on = ""; run ="tab_switch -1 --relative"; } { on = ""; run = "spot"; desc = "Spot hovered file"; } { on = "M"; run = "plugin mount"; } { on = "p"; run = "plugin smart-paste"; desc = "Paste into the hovered directory or CWD"; } { on = ["g" "l"]; run = "plugin lazygit"; desc = "lazygit"; } { on = "F"; run = "plugin jump-to-char"; desc = "jump to char"; } { on = "k"; run = "plugin arrow -1"; desc = "up"; } { on = "j"; run = "plugin arrow 1"; desc = "down"; } { on = ""; run = "plugin arrow -1"; desc = "up"; } { on = ""; run = "plugin arrow 1"; desc = "down"; } ]; }; settings = { manager = { sort_dir_first = false; linemode = "mtime"; show_symlink = true; }; opener = { edit = [ { run = "emacsclient -r -n \"$@\""; desc = "open in current emacsclient"; orphan = true; } ]; extract = [ { run = "ouch d -y \"%*\""; desc = "Extract here with ouch"; for = "windows"; } { run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; for = "unix"; } ]; }; plugin = { prepend_preloaders = [ { name = "/mnt/**"; run = "noop"; } { name = "/home/emenel/mnt/**"; run = "noop"; } ]; append_previewers = [ { name = "*"; run = "file-extra-metadata"; } { name = "*.md"; run = "glow"; } { mime = "{image,audio,video}/*"; run = "mediainfo";} { mime = "application/x-subrip"; run = "mediainfo";} # Archive previewer { mime = "application/*zip"; run = "ouch"; } { mime = "application/x-tar"; run = "ouch"; } { mime = "application/x-bzip2"; run = "ouch"; } { mime = "application/x-7z-compressed"; run = "ouch"; } { mime = "application/x-rar"; run = "ouch"; } { mime = "application/x-xz"; run = "ouch"; } ]; append_spotters = [ { name = "*"; run = "file-extra-metadata"; } ]; prepend_fetchers = [ { id = "git"; name = "*"; run = "git"; } { id = "git"; name = "*/"; run = "git"; } ]; }; }; }; xdg.configFile."yazi/theme.toml".source = ../../homes/emenel/dotfiles/dot_config/yazi/theme.toml; xdg.configFile."yazi/flavors".source = ../../homes/emenel/dotfiles/dot_config/yazi/flavors; xdg.configFile."yazi/plugins".source = ../../homes/emenel/dotfiles/dot_config/yazi/plugins; }