diff options
| author | Arpit Chakladar <arpitchakladar@proton.me> | 2026-03-09 20:26:17 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@proton.me> | 2026-03-09 20:26:17 +0530 |
| commit | 3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb (patch) | |
| tree | a23adc82d229a2b919ea1fcfb11e343671619518 /modules/tools/fzf | |
| parent | d308f652cd9aab7c68daaf82abe1ec01ffaa698c (diff) | |
| download | home-manager-config-3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb.tar.gz home-manager-config-3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb.zip | |
Some minor code refactoring
Diffstat (limited to 'modules/tools/fzf')
| -rw-r--r-- | modules/tools/fzf/default.nix | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/modules/tools/fzf/default.nix b/modules/tools/fzf/default.nix index f971ca9..3d19eca 100644 --- a/modules/tools/fzf/default.nix +++ b/modules/tools/fzf/default.nix @@ -4,11 +4,17 @@ options.tools.fzf = { enable = lib.mkEnableOption "Enables fzf."; }; - - config = lib.mkIf config.tools.fzf.enable { + + config = let + shellIntegration = '' +${if config.tools.zsh.enable then + "eval \"$(fzf --zsh)\"" +else "eval \"$(fzf --bash)\""} + ''; + in lib.mkIf config.tools.fzf.enable { programs.fzf = { enable = true; - + defaultOptions = [ "--height 100%" "--layout=reverse" @@ -21,18 +27,18 @@ "--no-info" "--margin=\"1,2\"" ]; - + colors = with config.scheme.withHashtag; { fg = base05; # Foreground bg = "-1"; # Background (-1 for transparent) hl = base0D; # Highlight - + "fg+" = base07; # Foreground for selected item "bg+" = "-1"; # Background for selected item "hl+" = base0D; # Highlight for selected item - + gutter = "-1"; # Remove the white margin at the left - + info = base0B; # Info text (usually count of items) border = base03; # Border color prompt = base0A; # Prompt text color @@ -41,5 +47,10 @@ spinner = base0C; # Spinner color (during search) }; }; + + programs.zsh.initContent = lib.mkIf config.programs.zsh.enable + (lib.mkAfter shellIntegration); + programs.bash.initExtra = lib.mkIf config.programs.bash.enable + (lib.mkAfter shellIntegration); }; } |
