hm (wip): yazi plugins

This commit is contained in:
2026-10-11 14:57:35 +02:00
parent e61e73a743
commit ae0b0ebc82

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
@@ -11,60 +11,66 @@ let
}) names); }) names);
in in
{ {
home-manager.users.djai.programs.yazi = { home-manager.users."djai" = { lib, config, ... }: {
enable = true; programs.yazi = {
enableFishIntegration = true; enable = true;
plugins = with pkgs.yaziPlugins; { enableFishIntegration = true;
duckdb = duckdb; plugins = with pkgs.yaziPlugins; {
compress = compress; duckdb = duckdb;
bookmarks = bookmarks; jump-to-char = jump-to-char;
clipboard = clipboard; yafg = { # FIXME: can not use fzf mode because of fish :/
ouch = ouch; package = yafg;
rich-preview = rich-preview; setup = true;
jump-to-char = jump-to-char; settings = {
yafg = { toggle-mode-key = "alt-r";
package = yafg; editor = "nvim";
setup = true; args = [ "--noplugin" ];
settings = { file-arg-format = "+{row} {file}";
toggle-mode-key = "alt-t"; };
editor = "nvim";
args = [ "--noplugin" ];
file-arg-format = "+{row} {file}";
}; };
# FIXME: these don't work
# compress = compress; # nil value unique_name issue
# bookmarks = bookmarks; # rely on deprecated api
# relative-motions = relative-motions; # nil value mgr_emit
} // make_plugin ["starship" "close-and-restore-tab" "full-border"] ;
keymap = {
mgr.prepend_keymap = [
{on = [ "f" "m" "f" ]; description = "use fmf"; run = "plugin yafg";}
{on = [ "F" ]; description = "Jump to char"; run = "plugin jump-to-char";}
{on = [ "<C-t>" ]; description = "Restore previously closed tab"; run = "plugin close-and-restore-tab restore";}
# {on = [ "c" "a" "a" ]; description = "Archive selected files"; run = "plugin compress";}
# {on = [ "c" "a" "p" ]; description = "Archive selected files (encrypted)"; run = "plugin compress -p";}
# {on = [ "m" ]; description = "Save current position as bookmark "; run = "plugin bookmarks save";}
# {on = [ "'" ]; description = "Jump to bookmark "; run = "plugin bookmarks jump";}
# {on = [ "b" "d" ]; description = "Delete bookmark"; run = "plugin bookmarks delete";}
# {on = [ "B" "D" ]; description = "Delete all bookmarks"; run = "plugin bookmarks delete_all";}
# {on = [ "1" ]; run = "plugin relative-motions 1";}
# {on = [ "2" ]; run = "plugin relative-motions 2";}
# {on = [ "3" ]; run = "plugin relative-motions 3";}
# {on = [ "4" ]; run = "plugin relative-motions 4";}
# {on = [ "5" ]; run = "plugin relative-motions 5";}
# {on = [ "6" ]; run = "plugin relative-motions 6";}
# {on = [ "7" ]; run = "plugin relative-motions 7";}
# {on = [ "8" ]; run = "plugin relative-motions 8";}
# {on = [ "9" ]; run = "plugin relative-motions 9";}
];
}; };
relative-motions = relative-motions;
} // make_plugin ["starship" "close-and-restore-tab" "full-border"] ;
# FIXME: lots of these are wonky
keymap = {
mgr.prepend_keymap = [
{on = [ "F" "G" ]; description = "use fmf"; run = "plugin yafg";}
{on = [ "f" ]; description = "Jump to char"; run = "plugin jump-to-char";}
{on = [ "y" ]; description = "Yank selected files (copy)"; run = [ "yank" "plugin clipboard -- --action=copy" ];}
{on = [ "x" ]; description = "Yank selected files (cut)"; run = [ "yank --cut" "plugin clipboard -- --action=copy" ];}
{on = [ "<C-p>" ]; description = "Paste yanked clipboard files"; run = "plugin clipboard -- --action=paste";}
{on = [ "m" ]; description = "Save current position as bookmark "; run = "plugin bookmarks save";}
{on = [ "'" ]; description = "Jump to bookmark "; run = "plugin bookmarks jump";}
{on = [ "b" "d" ]; description = "Delete bookmark"; run = "plugin bookmarks delete";}
{on = [ "B" "D" ]; description = "Delete all bookmarks"; run = "plugin bookmarks delete_all";}
{on = [ "c" "a" "a" ]; description = "Archive selected files"; run = "plugin compress";}
{on = [ "c" "a" "p" ]; description = "Archive selected files (encrypted)"; run = "plugin compress -p";}
{on = [ "1" ]; run = "plugin relative-motions 1";}
{on = [ "2" ]; run = "plugin relative-motions 2";}
{on = [ "3" ]; run = "plugin relative-motions 3";}
{on = [ "4" ]; run = "plugin relative-motions 4";}
{on = [ "5" ]; run = "plugin relative-motions 5";}
{on = [ "6" ]; run = "plugin relative-motions 6";}
{on = [ "7" ]; run = "plugin relative-motions 7";}
{on = [ "8" ]; run = "plugin relative-motions 8";}
{on = [ "9" ]; run = "plugin relative-motions 9";}
{on = [ "<C-t>" ]; description = "Restore previously closed tab"; run = "plugin close-and-restore-tab restore";}
];
}; };
# append extra init.lua stuff after home-manager generates the file
xdg.configFile."yazi/init.lua".text =''
-- this is really for termfilechooser, where i want to start with the rename menu open
ya.emit("rename", {
empty = "stem",
cursor = "start",
})
'';
}; };
} }