2025-02-17 11:45:20 -05:00
|
|
|
{ inputs, pkgs, ... }:
|
2025-02-05 00:50:55 -05:00
|
|
|
{
|
2025-02-05 01:26:40 -05:00
|
|
|
programs.yazi = {
|
2025-02-05 00:50:55 -05:00
|
|
|
enable = true;
|
|
|
|
enableFishIntegration = true;
|
|
|
|
package = inputs.yazi.packages.x86_64-linux.default;
|
2025-03-21 16:50:54 -04:00
|
|
|
initLua = ./yazi/init.lua;
|
2025-02-05 00:50:55 -05:00
|
|
|
keymap = {
|
2025-02-06 18:58:39 -05:00
|
|
|
manager.prepend_keymap = [
|
2025-02-26 22:18:59 -05:00
|
|
|
{ on = "!"; run = "shell '$SHELL' --block"; desc = "Open shell here"; }
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = ["c" "d"]; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; desc = "Drag selection";}
|
|
|
|
{ on = ["c" "c"]; run = "yank"; desc = "Copy file"; }
|
|
|
|
{ on = ["c" "n"]; run = "copy filename"; desc = "Copy file name"; }
|
|
|
|
{ on = ["c" "N"]; run = "copy name_without_ext"; desc = "Copy file name without extension"; }
|
2025-02-05 00:50:55 -05:00
|
|
|
{ on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; }
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; desc = "Go to top of git repo"; }
|
|
|
|
{ on = ["g" "p"]; run = "cd ~/Projects"; desc = "Go to ~/Projects"; }
|
2025-02-06 18:58:39 -05:00
|
|
|
{ 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 = "<C-t>"; run ="tab_create"; }
|
|
|
|
{ on = "<C-w>"; run ="tab_close"; }
|
|
|
|
{ on = "<C-A-right>"; run ="tab_switch 1 --relative"; }
|
|
|
|
{ on = "<C-A-left>"; run ="tab_switch -1 --relative"; }
|
|
|
|
{ on = "<Tab>"; 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"; }
|
2025-02-08 18:49:54 -05:00
|
|
|
{ on = ["g" "l"]; run = "plugin lazygit"; desc = "lazygit"; }
|
2025-02-12 16:15:41 -05:00
|
|
|
{ on = "k"; run = "plugin arrow -1"; desc = "up"; }
|
|
|
|
{ on = "j"; run = "plugin arrow 1"; desc = "down"; }
|
|
|
|
{ on = "<Up>"; run = "plugin arrow -1"; desc = "up"; }
|
|
|
|
{ on = "<Down>"; run = "plugin arrow 1"; desc = "down"; }
|
2025-02-17 12:12:38 -05:00
|
|
|
{ on = "C"; run = "plugin ouch zip"; }
|
|
|
|
{ on = "T"; run = "plugin smart-tab"; desc = "Create a tab and enter the hovered directory"; }
|
|
|
|
{ on = "l"; run = "plugin smart-enter"; desc = "Enter the child directory, or open the file"; }
|
|
|
|
{ on = "<Enter>"; run = "plugin smart-enter"; desc = "Enter the child directory, or open the file"; }
|
|
|
|
{ on = "<Right>"; run = "plugin smart-enter"; desc = "Enter the child directory, or open the file"; }
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = "<Backspace>"; run = "remove"; }
|
2025-02-26 22:18:59 -05:00
|
|
|
|
|
|
|
{ on = [ "t" "s" ]; run = "plugin what-size"; desc = "Calc size of selection or cwd"; }
|
|
|
|
|
|
|
|
{ on = ["d" "u"]; run = "plugin restore"; desc = "Restore last deleted files/folders"; }
|
|
|
|
{ on = ["d" "d"]; run = "remove"; desc = "Delete files/folders"; }
|
|
|
|
|
|
|
|
{ on = ["F" "g"]; run = "plugin fg"; desc = "Find file by content (fuzzy)"; }
|
|
|
|
{ on = ["F" "G"]; run = "plugin fg rg"; desc = "Find file by content (ripgrep)"; }
|
|
|
|
{ on = ["F" "f"]; run = "plugin fg fzf"; desc = "Find file by name (fuzzy)"; }
|
2025-02-05 00:50:55 -05:00
|
|
|
];
|
|
|
|
};
|
2025-02-06 18:58:39 -05:00
|
|
|
settings = {
|
|
|
|
manager = {
|
|
|
|
sort_dir_first = false;
|
2025-02-12 16:15:41 -05:00
|
|
|
linemode = "mtime";
|
|
|
|
show_symlink = true;
|
2025-02-06 18:58:39 -05:00
|
|
|
};
|
|
|
|
opener = {
|
2025-03-05 12:45:09 -05:00
|
|
|
# open = [
|
|
|
|
# { run = "plugin open-with-cmd block"; desc = "Open with command in the terminal"; }
|
|
|
|
# { run = "plugin open-with-cmd"; desc = "Open with command"; }
|
|
|
|
# ];
|
2025-02-06 18:58:39 -05:00
|
|
|
edit = [
|
2025-02-09 12:37:06 -05:00
|
|
|
{ run = "emacsclient -r -n \"$@\""; desc = "open in current emacsclient"; orphan = true; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
extract = [
|
2025-02-17 11:45:20 -05:00
|
|
|
{ run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
plugin = {
|
2025-02-12 16:15:41 -05:00
|
|
|
prepend_preloaders = [
|
|
|
|
{ name = "/mnt/**"; run = "noop"; }
|
2025-02-17 11:45:20 -05:00
|
|
|
{ name = "/home/emenel/Mounts/**"; run = "noop"; }
|
2025-02-12 16:15:41 -05:00
|
|
|
];
|
2025-03-05 12:45:09 -05:00
|
|
|
prepend_previewers = [
|
|
|
|
{ name = "*.csv"; run = "rich-preview"; }
|
|
|
|
{ name = "*.md"; run = "rich-preview" ; }
|
|
|
|
{ name = "*.rst"; run = "rich-preview"; }
|
|
|
|
{ name = "*.ipynb"; run = "rich-preview"; }
|
|
|
|
{ name = "*.json"; run = "rich-preview"; }
|
|
|
|
{ name = "*.lisp"; run = "rich-preview"; }
|
|
|
|
{ name = "*.el"; run = "rich-preview"; }
|
|
|
|
{ name = "*.org"; run = "rich-preview"; }
|
|
|
|
];
|
2025-02-06 18:58:39 -05:00
|
|
|
append_previewers = [
|
2025-03-05 12:45:09 -05:00
|
|
|
{ mime = "{image,audio,video}/*"; run = "mediainfo";}
|
|
|
|
{ mime = "application/x-subrip"; run = "mediainfo";}
|
2025-02-06 18:58:39 -05:00
|
|
|
# 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"; }
|
2025-02-23 12:42:17 -05:00
|
|
|
{ mime = "application/octet-stream"; run = "ouch"; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
2025-03-05 12:45:09 -05:00
|
|
|
_spotters = [
|
2025-02-06 18:58:39 -05:00
|
|
|
{ name = "*"; run = "file-extra-metadata"; }
|
|
|
|
];
|
|
|
|
prepend_fetchers = [
|
2025-02-23 12:42:17 -05:00
|
|
|
{
|
|
|
|
id = "mime";
|
|
|
|
name = "*";
|
|
|
|
run = "mime-ext";
|
|
|
|
prio = "high";
|
|
|
|
}
|
2025-03-05 12:45:09 -05:00
|
|
|
# {
|
|
|
|
# id = "git";
|
|
|
|
# name = "*";
|
|
|
|
# run = "git";
|
|
|
|
# }
|
|
|
|
# {
|
|
|
|
# id = "git";
|
|
|
|
# name = "*/";
|
|
|
|
# run = "git";
|
|
|
|
# }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2025-02-05 00:50:55 -05:00
|
|
|
};
|
|
|
|
|
2025-03-21 16:50:54 -04:00
|
|
|
xdg.configFile."yazi/theme.toml".source = ./yazi/theme.toml;
|
|
|
|
xdg.configFile."yazi/flavors".source = ./yazi/flavors;
|
|
|
|
xdg.configFile."yazi/plugins".source = ./yazi/plugins;
|
2025-02-05 00:50:55 -05:00
|
|
|
}
|