qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.62k stars 218 forks source link

fzf-lua doesn't work in VimR #972

Closed nadavshatz closed 11 months ago

nadavshatz commented 1 year ago

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 🍻

kakas commented 1 year ago

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')
nadavshatz commented 1 year ago

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!

ibhagwan commented 1 year ago

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

nadavshatz commented 11 months ago

Managed to get it working 🙏🏼