Skip to content

Commit

Permalink
fix: fzf fileWidgetOptions syntax with conditional
Browse files Browse the repository at this point in the history
Use conditional to determine fzf `fileWidgetOptions` syntax
  • Loading branch information
AVGVSTVS96 committed Nov 17, 2024
1 parent 30a8157 commit 13eb9d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/shared/programs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ in
"--border"
];
fileWidgetCommand = "fd --hidden --strip-cwd-prefix --exclude .git";
fileWidgetOptions = [
"--preview 'if [ -d {} ]; then eza --tree --all --level=3 --color=always {} | head -200; else bat -n --color=always --line-range :500 {}; fi'"
];
fileWidgetOptions =
if isFish then
[ "--preview 'if test -d {}; eza --tree --all --level=3 --color=always {} | head -200; else; bat -n --color=always --line-range :500 {}; end'" ]
else
[ "--preview 'if [ -d {} ]; then eza --tree --all --level=3 --color=always {} | head -200; else bat -n --color=always --line-range :500 {}; fi'" ];
changeDirWidgetCommand = "fd --type d --hidden --strip-cwd-prefix --exclude .git";
changeDirWidgetOptions = [ "--preview 'eza --tree --color=always {} | head -200'" ];
};
Expand Down

0 comments on commit 13eb9d8

Please sign in to comment.