Start migration to using flake-parts
This commit is contained in:
87
features-home-manager/yazi/default.nix
Normal file
87
features-home-manager/yazi/default.nix
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
exiftool
|
||||
unar # extract archives
|
||||
dragon-drop # dragndrop
|
||||
poppler-utils # pdf preview
|
||||
fd
|
||||
ripgrep
|
||||
fzf
|
||||
jq # json preview
|
||||
ffmpegthumbnailer
|
||||
xclip
|
||||
];
|
||||
|
||||
home.shellAliases = {
|
||||
y = "yy"; # Yazi shell wrapper (cd on quit)
|
||||
};
|
||||
|
||||
programs.yazi.enable = true;
|
||||
programs.yazi.enableFishIntegration = true;
|
||||
programs.yazi.settings.manager = {
|
||||
sort_by = "mtime";
|
||||
sort_reverse = true;
|
||||
show_hidden = true;
|
||||
};
|
||||
|
||||
programs.yazi.keymap = {
|
||||
manager.prepend_keymap = [
|
||||
# Override defaults
|
||||
{
|
||||
on = ["e"];
|
||||
run = ''shell --orphan --confirm "pcmanfm &"'';
|
||||
desc = "Open gui file manager";
|
||||
}
|
||||
{
|
||||
on = ["<C-o>"];
|
||||
run = ''shell "$SHELL" --block --confirm'';
|
||||
desc = "Open shell here";
|
||||
}
|
||||
{
|
||||
on = ["<C-n>"];
|
||||
run = ''shell 'dragon -x -i -T "$1"' --confirm'';
|
||||
desc = "Dragndrop via dragon";
|
||||
}
|
||||
{
|
||||
on = ["<Enter>"];
|
||||
run = "plugin --sync smart-enter";
|
||||
desc = "Enter the child directory, or open the file";
|
||||
}
|
||||
];
|
||||
input.prepend_keymap = [
|
||||
{
|
||||
on = ["<Esc>"];
|
||||
run = "close";
|
||||
desc = "Cancel input";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.yazi.settings.opener = {
|
||||
play = [
|
||||
{
|
||||
run = ''vlc "$1"'';
|
||||
orphan = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile."yazi/flavors" = {
|
||||
source = "${inputs.yazi-flavors}";
|
||||
};
|
||||
xdg.configFile."yazi/plugins/smart-enter.yazi/init.lua".text = ''
|
||||
return {
|
||||
entry = function()
|
||||
local h = cx.active.current.hovered
|
||||
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
|
||||
end,
|
||||
}
|
||||
'';
|
||||
programs.yazi.theme = {
|
||||
flavor.use = "catppuccin-mocha";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user