zellij: option to enable completions without enabling autostart
bit complicated to do this without breaking changes to the existing
`enableFishIntegration`... 🤔
This commit is contained in:
parent
96a643b2c9
commit
4b54a38bb5
|
@ -49,7 +49,13 @@ in {
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
enableFishIntegration = mkEnableOption "Fish integration" // {
|
enableFishIntegration = mkEnableOption "Fish integration (enables both enableFishAutostart and enableFishCompletions)" // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
enableFishAutostart = mkEnableOption "autostart zellij in interactive sessions" // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
enableFishCompletions = mkEnableOption "load zellij completions" // {
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -77,10 +83,15 @@ in {
|
||||||
eval "$(${zellijCmd} setup --generate-auto-start zsh)"
|
eval "$(${zellijCmd} setup --generate-auto-start zsh)"
|
||||||
'');
|
'');
|
||||||
|
|
||||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration
|
programs.fish.interactiveShellInit = mkIf (cfg.enableFishIntegration || cfg.enableFishAutostart || cfg.enableFishCompletions)
|
||||||
(mkOrder 200 ''
|
(mkOrder 200 (
|
||||||
eval (${zellijCmd} setup --generate-auto-start fish | string collect)
|
(if cfg.enableFishIntegration || cfg.enableFishCompletions then ''
|
||||||
eval (${zellijCmd} setup --generate-completion fish | string collect)
|
eval (${zellijCmd} setup --generate-completion fish | string collect)
|
||||||
'');
|
'' else "") +
|
||||||
|
(if cfg.enableFishIntegration || cfg.enableFishAutostart then ''
|
||||||
|
eval (${zellijCmd} setup --generate-auto-start fish | string collect)
|
||||||
|
'' else "")
|
||||||
|
));
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue