vimr icon indicating copy to clipboard operation
vimr copied to clipboard

fzf-lua doesn't work in VimR

Open nadavshatz opened this issue 2 years ago • 2 comments

Hi all - I absolutely love using VimR and recently something happened and https://github.com/ibhagwan/fzf-lua stopped working under it. the same exact setup works in CLI but not in VimR.

I've been trying to debug and find the issue with no luck. Any kind of guidance on how to even go about finding the issue would be most appreciated. Once i find it i'll also do my best in fixing it.

Cheers 🍻

nadavshatz avatar Aug 17 '22 08:08 nadavshatz

I'm using the telescope as well as the telescope-fzf-native. They work very well, you may give it a try

here are my settings. packer.

return require('packer').startup(function(use)
  -- ...
  use {
    'nvim-telescope/telescope.nvim',
    requires = { { 'nvim-lua/plenary.nvim' } }
  }
  use {
    'nvim-telescope/telescope-fzf-native.nvim',
    run = 'make'
  }
  -- ...
end)
require('telescope').setup {
  defaults = {
    mappings = {
      i = {
        ["<C-j>"] = "move_selection_next",
        ["<C-k>"] = "move_selection_previous"
      }
    }
  },
  extensions = {
    fzf = {
      fuzzy = true, -- false will only do exact matching
      override_generic_sorter = true, -- override the generic sorter
      override_file_sorter = true, -- override the file sorter
      case_mode = "smart_case", -- or "ignore_case" or "respect_case"
      -- the default case_mode is "smart_case"
    }
  }
}
require('telescope').load_extension('fzf')

kakas avatar Aug 26 '22 02:08 kakas

Thanks for the info - fzf through fzf.vim works fine for me. But I've found fzf-lua much nicer and for some reason it doesn't work.

Like I mentioned I'm happy to dive into the why and try and fix it but I'm not sure how to go about it. Any suggestions?

Thanks!

nadavshatz avatar Aug 27 '22 09:08 nadavshatz

FYI, just implemented a one liner workaround to make fzf-lua work in VimR, update to the latest fzf-lua commit and add to your config:

-- make sure “nvim” is a valid neovim shell binary
vim.env.FZF_LUA_NVIM_BIN="nvim"

For more info: https://github.com/ibhagwan/fzf-lua/issues/651#issuecomment-1435087945

ibhagwan avatar Feb 17 '23 19:02 ibhagwan

Managed to get it working 🙏🏼

nadavshatz avatar Aug 10 '23 06:08 nadavshatz