{ flakeDir, dev, ... }: { programs.yazi.keymap = { manager = { prepend_keymap = [ # MAIN { on = "q"; run = "close"; desc = "Close tab/yazi"; } { on = "l"; run = "plugin --sync smart-enter"; desc = "Enter/open"; } { on = "!"; run = "shell '$SHELL' --block --confirm"; desc = "Enter to shell"; } { on = ""; run = "close"; desc = "Close"; } { on = ""; run = "plugin --sync smart-enter"; desc = "Enter/open"; } { on = ""; run = "plugin --sync smart-enter"; desc = "Enter/open"; } # VISUAL { on = [ "v" "m" ]; run = "plugin --sync max-preview"; desc = "Maximize preview"; } { on = [ "v" "p" ]; run = "plugin --sync hide-preview"; desc = "Hide preview"; } { on = [ "v" "v" ]; run = "visual_mode"; desc = "Select mode"; } { on = [ "v" "V" ]; run = "visual_mode --unset"; desc = "Un-select mode"; } { on = [ "v" "a" ]; run = "select_all --state=true"; desc = "Select all"; } { on = [ "v" "r" ]; run = "select_all --state=none"; desc = "Unselect all"; } { on = [ "v" "h" ]; run = "hidden toggle"; desc = "Hidden files with .*"; } # DELETION { on = [ "d" "d" ]; run = "remove"; desc = "Delete"; } { on = [ "d" "D" ]; run = "remove --permanently"; desc = "Delete permanently"; } { on = [ "D" "d" ]; run = "remove --force"; desc = "Delete force"; } { on = [ "D" "D" ]; run = "remove --permanently --force"; desc = "Delete permanently via force"; } # CREATE { on = [ "a" "f" ]; run = "create"; desc = "Create file"; } { on = [ "a" "d" ]; run = "create --dir"; desc = "Create directory"; } # RENAME { on = [ "r" "r" ]; run = "rename --cursor=end"; desc = "Rename"; } { on = [ "r" "n" ]; run = "rename --empty=stem --cursor=start"; desc = "Rename namefile"; } { on = [ "r" "e" ]; run = "rename --empty=ext --cursor=end"; desc = "Rename extension"; } { on = [ "r" "a" ]; run = "rename --empty=all"; desc = "Delete all and rename"; } # NAVIGATE { on = [ "c" "d" ]; run = "cd --interactive"; desc = "Jump interactively"; } { on = [ "g" "f" "f" ]; run = "cd ${flakeDir}"; desc = "Go to flake main dir"; } { on = [ "g" "f" "h" ]; run = "cd ${flakeDir}/modules/home"; desc = "Go to home modules"; } { on = [ "g" "f" "H" ]; run = "cd ${flakeDir}/modules/host"; desc = "Go to nixos modules"; } { on = [ "g" "n" "s" ]; run = "cd /nix/store"; desc = "Go to store"; } { on = [ "g" "d" "h" ]; run = "cd ${dev.hdd}"; desc = "Go to HDD"; } { on = [ "g" "d" "s" ]; run = "cd ${dev.ssd}"; desc = "Go to SSD"; } # TABS { on = [ "]" ]; run = "tab_switch -1 --relative"; desc = "Switch to the next tab"; } { on = [ "[" ]; run = "tab_switch 1 --relative"; desc = "Switch to the previous tab"; } # PASTE { on = [ "p" "p" ]; run = "paste"; desc = "Paste yanked files"; } { on = [ "p" "P" ]; run = "plugin --sync smart-paste"; desc = "Paste yanked files in preview dir"; } # MOUNTOPTIONS { on = [ "m" "a" ]; run = "plugin archivemount --args=mount"; desc = "Mount selected archive"; } { on = [ "m" "u" ]; run = "plugin archivemount --args=unmount"; desc = "Unmount and save changes to original archive"; } # MTPFS { on = [ "M" "m" ]; run = "plugin simple-mtpfs --args=select-then-mount"; desc = "Select device then mount"; } { on = [ "M" "u" ]; run = "plugin simple-mtpfs --args=select-then-unmount"; desc = "Select device then unmount"; } { on = [ "g" "m" ]; run = "plugin simple-mtpfs --args=jump-to-device"; desc = "Select device then jump to its mount point"; } { on = [ "`" "`" ]; run = "plugin simple-mtpfs --args=jump-back-prev-cwd"; desc = "Jump back to the position before jumped to device"; } ]; }; completion = { prepend_keymap = [ { on = ""; run = "arrow 1"; } { on = ""; run = "arrow -1"; } ]; }; }; }