NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.48k stars 13.67k forks source link

Cannot access :FZF from within neovim anymore #90715

Closed confususs closed 3 years ago

confususs commented 4 years ago

Issue description

This problem started after I updated using nixos-rebuild switch and home-manager switch.

I'm using the following packages together:

Snippet from my configuration.nix

..
environment.systemPackages = with pkgs; [
  ...
  fzf
  ..
];

Snippet from my home.nix

  programs.neovim = {
    enable = true;
    vimAlias = true;

    configure = {
      customRC = builtins.readFile ./init.vim;
      vam.knownPlugins = pkgs.vimPlugins;
      vam.pluginDictionaries = let 
        names = [
           ..
          "fzf-vim"
           ..
        ];
       in map (name: { inherit name; }) names;
    };
  };

Steps to reproduce

  1. Open neovim
  2. Call :FZF
  3. Not an editor command: FZF

Technical details

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.43, NixOS, 20.09pre229870.22c98819ccd (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.6`
 - channels(root): `"nixos-20.09pre229870.22c98819ccd"`
 - channels(ard): `"home-manager"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

I don't really know where the issue is coming from, maybe the fzfWrapper is not correctly wrapping & exposing fzf anymore? Thank you!

Ma27 commented 4 years ago

Can reproduce this on latest nixos-unstable. Temporary fix is to add fzfWrapper to pluginDictionaries, but not really sure why (IIRC this has been fixed in the past).

In case I have time to, I can take a look soon.

doronbehar commented 4 years ago

The issue is that fzf (the plain go package) includes in ${fzf.out}/share/vim-plugins the fzf.vim plugin file but we don't have a consensus regarding https://github.com/NixOS/nixpkgs/issues/56338 .

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

teto commented 3 years ago

Closing to clear up the tracker, if you use the native package manager of vim in nix you should be fine.

foosinn commented 2 years ago

Hey, seems to be still broken for me. I am using the syntax from the wiki to install it:

    packages.myNvim = with pkgs.vimPlugins; {
      start = [
        airline
        easymotion
        editorconfig-vim
        fzf
        fzf-lsp-nvim
        LanguageClient-neovim
        ncm2
        nnn-vim
        surround
        syntastic
        vim-addon-nix
        vim-highlightedyank
        vim-which-key
      ];
    };

Is there anything i missed?

doronbehar commented 2 years ago

Is there anything i missed?

Yes. I'm not using Nix to configure my Vim environment so I might not be super helpful, but I think that specifically for fzf, you should somehow source ${fzf.vim}/share/vim-plugins/fzf/plugin/fzf.vim in your vimrc before your fzf dependent plugins are loaded. The reason we closed this issue is because we need to reach a consensus regarding how to handle vim plugins like that in general, as discussed a bit in https://github.com/NixOS/nixpkgs/issues/56338 and then we can decide how to address the issue you are experiencing.