mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
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:
parent
2f857761d0
commit
ca7868dc29
1 changed files with 19 additions and 0 deletions
|
@ -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 ''
|
||||
|
|
Loading…
Reference in a new issue