marleyos/old/home/programs/fzf.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2024-11-03 14:49:09 -08:00
{ lib, config, ... }:
let
has-ripgrep = config.programs.ripgrep.enable;
has-fd = config.programs.fd.enable;
has-eza = config.programs.eza.enable;
has-bat = config.programs.bat.enable;
has-tmux = config.programs.tmux.enable;
has-delta = config.programs.git.delta.enable;
in
2024-11-03 14:49:09 -08:00
{
programs.fzf = {
enable = true;
rose-pine.enable = true;
defaultOptions = [
"--margin=10%,5%"
"--border=sharp"
"--pointer= "
"--marker= "
"--prompt= "
"--preview-label-pos='bottom'"
"--preview-window='border-sharp'"
];
defaultCommand = lib.mkIf has-ripgrep "rg --files --hidden --glob \"!.git\"";
2024-11-03 14:49:09 -08:00
changeDirWidgetCommand = lib.mkIf has-fd "fd --type d";
changeDirWidgetOptions = lib.mkIf has-eza [
2024-11-03 14:49:09 -08:00
"--preview 'eza --all --color=always --sort=name --group-directories-first --level=3 {}'"
];
fileWidgetCommand = lib.mkIf has-fd "fd --type f";
fileWidgetOptions = lib.mkIf has-bat [
2024-11-03 14:49:09 -08:00
"--preview 'bat {}'"
];
tmux.enableShellIntegration = lib.mkIf has-tmux true;
2024-11-03 14:49:09 -08:00
};
home.sessionVariables = lib.mkIf has-delta {
fzf_diff_highlighter = "delta --paging=never --features=arctic-fox";
};
2024-11-03 14:49:09 -08:00
}