blob: 8816dddb2b5ef09c5654b6ef74e6cdee72b49de1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
{ config, lib, ... }:
# FZF - Fuzzy finder, CLI fuzzy search tool
{
config =
let
shellIntegration = ''
${if config.programs.zsh.enable then "eval \"$(fzf --zsh)\"" else "eval \"$(fzf --bash)\""}
'';
in
lib.mkIf config.programs.fzf.enable {
programs.fzf = {
defaultOptions = [
"--height 100%"
"--layout=reverse"
''--pointer=\" \"''
''--header=\" \"''
''--prompt=\" \"''
''--marker=\"✓ \"''
"--border=none"
"--cycle"
"--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
pointer = base0F; # Pointer color (e.g., > for selected)
marker = base0C; # Marker color (e.g., for multi-select)
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);
};
}
|