nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.36k stars 45 forks source link

fzf_lib.lua module 'ffi" not found -- This extension doesn't exist or is not installed: fzf #48

Closed jpapciak closed 2 years ago

jpapciak commented 2 years ago

I'm new-ish to all of this, but trying to copy an init.nvim config I have working on my arch linux workstation at work to a couple of different environments on different operating systems and different hardware and encountering this error on each.

FWIW this is currently my init.vim and I'm trying it on an Alma Linux VM, but have encountered this on an Ubuntu 21 server on a raspberry pi, and an Ubuntu 20 server on a VM as well.

`" Plugins will be downloaded under the specified directory. call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')

" Declare the list of plugins. Plug 'tpope/vim-sensible' Plug 'junegunn/seoul256.vim' Plug 'joshdick/onedark.vim' Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'mattn/emmet-vim' Plug 'neovim/nvim-lspconfig' Plug 'Mofiqul/dracula.nvim' Plug 'tpope/vim-fugitive' Plug 'nvim-lualine/lualine.nvim' Plug 'kyazdani42/nvim-web-devicons' Plug 'chun-yang/auto-pairs' Plug 'Pocco81/AutoSave.nvim' Plug 'arcticicestudio/nord-vim' Plug 'haishanh/night-owl.vim' Plug 'alvan/vim-closetag' Plug 'embark-theme/vim', { 'as': 'embark', 'branch': 'main' } Plug 'ambv/black' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }

" List ends here. Plugins become visible to Vim after this call. call plug#end()

set tabstop=4 softtabstop=4 set shiftwidth=4 set smartindent set termguicolors set scrolloff=8 set number set relativenumber

colorscheme embark hi Normal guibg=NONE ctermbg=NONE

" Find files using Telescope command-line sugar. nnoremap ff Telescope find_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers nnoremap fh Telescope help_tags nnoremap gf Telescope git_files

" Using Lua functions nnoremap ff lua require('telescope.builtin').find_files() nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap fh lua require('telescope.builtin').help_tags() nnoremap f :lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({}))

" use for trigger completion and navigate to the next complete item function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~ '\s' endfunction

inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh()

lua << EOF require'lspconfig'.pyright.setup{}

local pickers = require("telescope.pickers") local finders = require("telescope.finders") local previewers = require("telescope.previewers") local action_state = require("telescope.actions.state") local conf = require("telescope.config").values local actions = require("telescope.actions")

-- You dont need to set any of these options. These are the default ones. Only -- the loading is important require('telescope').setup { 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" } } } -- To get fzf loaded and working with telescope, you need to call -- load_extension, somewhere after setup function: require('telescope').load_extension('fzf')

EOF`

And my nvim version info

$ nvim -v NVIM v0.6.0 Build type: Debug Lua 5.1

Apologies if I'm missing something, I've been at this for three days now.

Conni2461 commented 2 years ago

fzf-native requires ffi. Lua 5.1 doesnt have an ffi module. You need luajit which is the suggested lua version for neovim and if you build it normally thats what you get (at least on x86, arm can be more difficult).

You can try to install something like this: https://github.com/facebookarchive/luaffifb to get ffi in lua 5.1 but this is unsupported by me and I have never tried it.

jpapciak commented 2 years ago

I wasn't able to get that working so ended up reinstalling with arch which I guess has the ffi module built in or something. Thanks for pointing me in the right direction