From 8d4c65f259a2f5508d6a1c667f02facafb3b3010 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 30 Oct 2018 00:09:20 +0100 Subject: [PATCH] fzf: only enable when line editing is available Fixes #401 Suggested-by: Alex Vorobiev Suggested-by: Mario Rodas --- modules/programs/fzf.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix index 7279d903..832c0bfa 100644 --- a/modules/programs/fzf.nix +++ b/modules/programs/fzf.nix @@ -122,13 +122,17 @@ in ); programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - . ${pkgs.fzf}/share/fzf/completion.bash - . ${pkgs.fzf}/share/fzf/key-bindings.bash + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + . ${pkgs.fzf}/share/fzf/completion.bash + . ${pkgs.fzf}/share/fzf/key-bindings.bash + fi ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - . ${pkgs.fzf}/share/fzf/completion.zsh - . ${pkgs.fzf}/share/fzf/key-bindings.zsh + if [[ $options[zle] = on ]]; then + . ${pkgs.fzf}/share/fzf/completion.zsh + . ${pkgs.fzf}/share/fzf/key-bindings.zsh + fi ''; }; }