dotfiles/home/users/yazi.nix
2026-08-13 18:07:59 +03:00

79 lines
2.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, pkgs, ... }:
{
programs.yazi = {
enable = true;
# Основные настройки
settings = {
manager = {
sort_by = "natural";
sort_dir_first = false;
linemode = "size_and_mtime";
show_symlink = true;
};
preview = {
wrap = "no";
tab_size = 4;
};
opener = {
play = [
{
run = "mpv %s";
orphan = true;
for = "unix";
}
];
edit = [
{
run = ''cd "''${YAZI_ORIGINAL_CWD:-''${PWD}}" && "''${EDITOR:-nano}" %s'';
block = true;
for = "unix";
}
];
open = [
{
run = "xdg-open %s1";
desc = "Open";
}
];
};
plugin.prepend_fetchers = [
{ group = "git"; url = "*"; run = "git"; }
{ group = "git"; url = "*/"; run = "git"; }
];
};
# Хоткеи
keymap.mgr = {
prepend_keymap = [
{ on = "h"; run = "leave"; desc = "Назад (вверх по иерархии)"; }
{ on = "n"; run = "arrow next"; desc = "Вниз"; }
{ on = "e"; run = "arrow prev"; desc = "Вверх"; }
{ on = "M"; run = "plugin mount"; }
{ on = "F"; run = "plugin jump-to-char"; desc = "Jump to char"; }
{ on = "i"; run = "plugin smart-enter"; desc = "Enter the child directory, or open the file"; }
{ on = [ "c" "m" ]; run = "plugin chmod"; desc = "Chmod on selected files"; }
{ on = [ "<C-n>" ]; run = "seek 1"; desc = "Scroll preview down 1 line"; }
{ on = [ "<C-p>" ]; run = "seek -1"; desc = "Scroll preview up 1 line"; }
];
append_keymap = [
{ on = [ "c" "e" ]; run = "shell -- flipbit x %h"; desc = "Toggle execution mode on file"; }
];
};
# Плагины
plugins = {
git.package = pkgs.yaziPlugins.git;
mount.package = pkgs.yaziPlugins.mount;
jump-to-char.package = pkgs.yaziPlugins.jump-to-char;
smart-enter.package = pkgs.yaziPlugins.smart-enter;
chmod.package = pkgs.yaziPlugins.chmod;
};
};
}