nixos/fzf: fix bash with `fuzzyCompletion`

put all of fzf initialization after the bash-completions initialization
in bashrc, as the upstream project suggests in
https://github.com/junegunn/fzf/issues/72

Fixes: #303195
This commit is contained in:
Thomas Mühlbacher 2024-04-16 20:34:12 +02:00
parent 3ad65e9f48
commit dd64d62858
1 changed files with 3 additions and 2 deletions

View File

@ -15,11 +15,12 @@ in
environment.systemPackages = lib.mkIf (cfg.keybindings || cfg.fuzzyCompletion) [ pkgs.fzf ];
programs = {
bash.interactiveShellInit = lib.optionalString cfg.fuzzyCompletion ''
# load after programs.bash.enableCompletion
bash.promptPluginInit = lib.mkAfter (lib.optionalString cfg.fuzzyCompletion ''
source ${pkgs.fzf}/share/fzf/completion.bash
'' + lib.optionalString cfg.keybindings ''
source ${pkgs.fzf}/share/fzf/key-bindings.bash
'';
'');
zsh = {
interactiveShellInit = lib.optionalString (!config.programs.zsh.ohMyZsh.enable)