mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00:00
fzf: add colors option (#3206)
This commit is contained in:
parent
c0f9cbcf93
commit
433e8de330
1 changed files with 25 additions and 1 deletions
|
@ -6,6 +6,10 @@ let
|
|||
|
||||
cfg = config.programs.fzf;
|
||||
|
||||
renderedColors = colors:
|
||||
concatStringsSep ","
|
||||
(mapAttrsToList (name: value: "${name}:${value}") colors);
|
||||
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "programs" "fzf" "historyWidgetCommand" ]
|
||||
|
@ -88,6 +92,24 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
colors = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
bg = "#1e1e1e";
|
||||
"bg+" = "#1e1e1e";
|
||||
fg = "#d4d4d4";
|
||||
"fg+" = "#d4d4d4";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Color scheme options added to <code>FZF_DEFAULT_OPTS</code>. See
|
||||
<link xlink:href="https://github.com/junegunn/fzf/wiki/Color-schemes"/>
|
||||
for documentation.
|
||||
'';
|
||||
};
|
||||
|
||||
tmux = {
|
||||
enableShellIntegration = mkEnableOption ''
|
||||
setting <literal>FZF_TMUX=1</literal> which causes shell integration to use fzf-tmux
|
||||
|
@ -141,7 +163,9 @@ in {
|
|||
FZF_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
||||
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
||||
FZF_DEFAULT_COMMAND = cfg.defaultCommand;
|
||||
FZF_DEFAULT_OPTS = cfg.defaultOptions;
|
||||
FZF_DEFAULT_OPTS = cfg.defaultOptions
|
||||
++ lib.optionals (cfg.colors != { })
|
||||
[ "--color ${renderedColors cfg.colors}" ];
|
||||
FZF_TMUX = if cfg.tmux.enableShellIntegration then "1" else null;
|
||||
FZF_TMUX_OPTS = cfg.tmux.shellIntegrationOptions;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue