fzf: option for tmux usage in shell integration (#1926)

Added options for setting:
FZF_TMUX
FZF_TMUX_OPTS
environment variables, which changes behaviour of fzf shell integration.
This commit is contained in:
Hans 2021-05-02 00:10:41 +02:00 committed by GitHub
parent 2f857761d0
commit ca7868dc29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,6 +88,23 @@ in {
'';
};
tmux = {
enableShellIntegration = mkEnableOption ''
setting <literal>FZF_TMUX=1</literal> which causes shell integration to use fzf-tmux
'';
shellIntegrationOptions = mkOption {
type = types.listOf types.str;
default = [ ];
example = literalExample ''[ "-d 40%" ]'';
description = ''
If <option>programs.fzf.tmux.enableShellIntegration</option> is set to <literal>true</literal>,
shell integration will use these options for fzf-tmux.
See <command>fzf-tmux --help</command> for available options.
'';
};
};
enableBashIntegration = mkOption {
default = true;
type = types.bool;
@ -125,6 +142,8 @@ in {
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
FZF_DEFAULT_COMMAND = cfg.defaultCommand;
FZF_DEFAULT_OPTS = cfg.defaultOptions;
FZF_TMUX = if cfg.tmux.enableShellIntegration then "1" else null;
FZF_TMUX_OPTS = cfg.tmux.shellIntegrationOptions;
});
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''