From 2585df4e81545e7d93294eea30c01b41a3781390 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 3 Nov 2024 14:49:09 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fzf):=20Install=20fzf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/programs/default.nix | 1 + home/programs/fzf.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 home/programs/fzf.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index 469a8c1..27c932f 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -8,6 +8,7 @@ ./curl.nix ./eza.nix ./fish.nix + ./fzf.nix ./gh.nix ./hyfetch.nix ./lazygit.nix diff --git a/home/programs/fzf.nix b/home/programs/fzf.nix new file mode 100644 index 0000000..c8294d3 --- /dev/null +++ b/home/programs/fzf.nix @@ -0,0 +1,37 @@ +{ lib, config, ... }: +{ + 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'" + ]; + + # TODO: Check that rg is installed. + defaultCommand = "rg --files --hidden --glob \"!.git\""; + + # TODO: Check that fd is installed. + changeDirWidgetCommand = "fd --type d"; + changeDirWidgetOptions = lib.mkIf config.programs.eza.enable [ + "--preview 'eza --all --color=always --sort=name --group-directories-first --level=3 {}'" + ]; + + # TODO: Check that fd is installed. + fileWidgetCommand = "fd --type f"; + fileWidgetOptions = lib.mkIf config.programs.bat.enable [ + "--preview 'bat {}'" + ]; + + tmux.enableShellIntegration = lib.mkIf config.programs.tmux.enable true; + }; + + home.sessionVariables.fzf_diff_highlighter = "delta --paging=never --features=arctic-fox"; +}