63 lines
1.4 KiB
Nix
63 lines
1.4 KiB
Nix
|
{pkgs, ...}: {
|
||
|
xdg.configFile."lf/icons".source = ./icons;
|
||
|
|
||
|
programs.lf = {
|
||
|
enable = true;
|
||
|
commands = {
|
||
|
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
|
||
|
editor-open = ''$$EDITOR $f'';
|
||
|
mkdir = ''
|
||
|
''${{
|
||
|
printf "Directory Name: "
|
||
|
read DIR
|
||
|
mkdir $DIR
|
||
|
}}
|
||
|
'';
|
||
|
};
|
||
|
keybindings = {
|
||
|
"\\\"" = "";
|
||
|
o = "";
|
||
|
m = "";
|
||
|
mm = "mark-save";
|
||
|
md = "mkdir";
|
||
|
"." = "set hidden!";
|
||
|
"`" = "mark-load";
|
||
|
"\\'" = "mark-load";
|
||
|
"<enter>" = "open";
|
||
|
|
||
|
d = "";
|
||
|
do = "dragon-out";
|
||
|
dd = "cut";
|
||
|
|
||
|
"g~" = "cd";
|
||
|
gh = "cd";
|
||
|
"g/" = "/";
|
||
|
|
||
|
ee = "editor-open";
|
||
|
V = ''$${pkgs.bat}/bin/bat --paging=always "$f"'';
|
||
|
};
|
||
|
settings = {
|
||
|
preview = true;
|
||
|
hidden = true;
|
||
|
drawbox = true;
|
||
|
icons = true;
|
||
|
ignorecase = true;
|
||
|
tabstop = 2;
|
||
|
};
|
||
|
previewer = {
|
||
|
keybinding = "i";
|
||
|
source = pkgs.writeShellScript "pv.sh" ''
|
||
|
#!/bin/sh
|
||
|
case "$1" in
|
||
|
*.tar*) ${pkgs.gnutar}/bin/tar tf "$1";;
|
||
|
*.zip) ${pkgs.unzip}/bin/unzip -l "$1";;
|
||
|
*.rar) ${pkgs.unrar}/bin/unrar l "$1";;
|
||
|
*.7z) ${pkgs.p7zip}/bin/7z l "$1";;
|
||
|
*.pdf) ${pkgs.poppler_utils}/bin/pdftotext "$1" -;;
|
||
|
*) ${pkgs.highlight}/bin/highlight -O ansi "$1" || cat "$1";;
|
||
|
esac
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|