Disabling fzf fish integration doesn't work

I want to disable sourcing fish scripts bundled with fzf (so I can use fzf.fish plugin exclusively). It seems like this should be possible with:

  programs.fish = {
    enable = true;
    # fzf conflicts with fish.fzf plugin so we don't load configs provided by other packages...
    vendor.functions.enable = false;
    vendor.config.enable = false;
    # ... and load the ones we like manually
    # check `ls -alh /run/current-system/sw/share/fish/vendor_conf.d` for a full list
    shellInit = ''
      source ${pkgs.direnv}/share/fish/vendor_conf.d/direnv.fish
      source ${pkgs.fishPlugins.fzf-fish}/share/fish/vendor_conf.d/fzf.fish
    '';
  };

My understanding is setting these to false will make this:

not link these config to profile.

However it doesn’t seem to work:

> ls /run/current-system/sw/share/fish/vendor_conf.d
direnv.fish  fzf.fish  load-fzf-key-bindings.fish

Am I misunderstanding something? Any ideas why is not working?

I’m getting the same behaviour. Ideally enabling fishPlugins.fzf-fish would disable the built-in fzf one.

1 Like

Did you have any luck working around this issue? Seems programs.fzf.enableFishIntegration = false; doesn’t stop it either

Nope. Gave up, wasn’t that important to me.

I’m interested in fixing this, so I’m posting here to remind myself to come back to it.

Note that normally (outside of a Nix context), you’d disable a vendor-supplied config snippet by preempting it in Fish’s config sourcing path with a file of the same name. So to completely disable vendor_conf.d/fzf.fish, you’d just create an empty file at ~/.config/fish/conf.d/fzf.fish. So the presence of the vendor-supplied config file in your Nix profile doesn’t necessarily mean that the integration is enabled.

1 Like

I was checking using the 3 bindings fzf enables. Worked around it by unbinding, then rebinding to the fishPlugin functions but the empty file could be an option.

Could you please show the changes you did to the code? I just stumbled across this issue.

1 Like

Long time ago but I hacked around the bindings with:

  programs.fish.interactiveShellInit = ''
    bind --erase \cr
    bind -M insert --erase \cr

    bind --erase \ec
    bind -M insert --erase \ec
    bind \ec __fzf_cd

    bind --erase \eO
    bind -M insert --erase \eO
    bind \\f __fzf_open
'';
1 Like

I used @pxc’s method to override the files in vendor_conf.d. For me, the file to override was named load-fzf-key-bindings.fish. Here’s what I did:

  • Install fzf itself using nix
  • Install fzf-fish maunally, because fishPlugins.fzf-fish was giving me errors that I couldn’t figure out: fisher install patrickf1/fzf.fish
  • touch .config/fish/conf.d/load-fzf-key-bindings.fish
  • Restart fish
1 Like