2024-11-03 14:49:09 -08:00
|
|
|
{ lib, config, ... }:
|
2024-11-03 19:00:37 -08:00
|
|
|
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'"
|
|
|
|
];
|
|
|
|
|
2024-11-03 19:00:37 -08:00
|
|
|
defaultCommand = lib.mkIf has-ripgrep "rg --files --hidden --glob \"!.git\"";
|
2024-11-03 14:49:09 -08:00
|
|
|
|
2024-11-03 19:00:37 -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 {}'"
|
|
|
|
];
|
|
|
|
|
2024-11-03 19:00:37 -08:00
|
|
|
fileWidgetCommand = lib.mkIf has-fd "fd --type f";
|
|
|
|
fileWidgetOptions = lib.mkIf has-bat [
|
2024-11-03 14:49:09 -08:00
|
|
|
"--preview 'bat {}'"
|
|
|
|
];
|
|
|
|
|
2024-11-03 19:00:37 -08:00
|
|
|
tmux.enableShellIntegration = lib.mkIf has-tmux true;
|
2024-11-03 14:49:09 -08:00
|
|
|
};
|
|
|
|
|
2024-11-03 19:00:37 -08:00
|
|
|
home.sessionVariables.fzf_diff_highlighter = lib.mkIf has-delta "delta --paging=never --features=arctic-fox";
|
2024-11-03 14:49:09 -08:00
|
|
|
}
|