nvim-colorizer.lua icon indicating copy to clipboard operation
nvim-colorizer.lua copied to clipboard

Need of Luajit, steps to install it

Open carlitux opened this issue 6 years ago • 9 comments

Describe the bug getting module 'ffi' not found as I do not have installed lua in system.

Expected behavior Do not have external dependencies

Operating System: POP OS 19.10

Neovim Version: NVIM v0.5.0-dev

Colorizer Version: aa5377f040907c5be86499195529c16cb9f5264bAdditional context

carlitux avatar Nov 25 '19 03:11 carlitux

It's not a bug. Luajit is a requirement. Unless Neovim has a trie in the core, that won't change. I use it in too many places. We are considering adding one to neovim for other things, but not for a while. Try building with Luajit available.

norcalli avatar Nov 25 '19 03:11 norcalli

got it, so need to clarify in README file.

It has an external dependency (out side neovim) and steps to install it. I don't have experience with lua.

just installed luajit still getting the error

carlitux avatar Nov 25 '19 11:11 carlitux

No I meant that neovim has luajit built in usually. For it not to be available on your platform is very rare. I'll try to see if I can make instructions for users who come across this problem.

norcalli avatar Nov 26 '19 15:11 norcalli

I also ran into this on Ubuntu 16.04 with Neovim v0.5.0-dev (0.5.0+ubuntu1+git202001142018-3d1531a-00e710e-8b2f2dc~ubuntu16.04.1)

I get this stacktrace when starting Vim (the first line is the one where I invoke lua require'colorizer'.setup())

Error detected while processing /home/dave/.dotfiles/vim/custom/500-plugins-config.vim:
line  917:
E5108: Error executing lua ...me/dave/.vim/bundle/nvim-colorizer.lua//lua/trie.lua:16: module 'ffi' not found:
        no field package.preload['ffi']
        no file '/home/dave/.config/nvim/lua/ffi.lua'
...

daveyarwood avatar Jan 16 '20 16:01 daveyarwood

For it not to be available on your platform is very rare.

From what I've read, I think it's more common than you think :)

I think we just need to wait for Ubuntu/Debian distros to catch up.

daveyarwood avatar Jan 16 '20 16:01 daveyarwood

@daveyarwood we have to wait till maintainer link luajit instead of lua. Now I am using appimage from github

carlitux avatar Jan 16 '20 19:01 carlitux

Actually I'm working on an update which works for both Lua and Luajit. Also I'm adding a color picker and support for notermguicolors

On Thu, Jan 16, 2020 at 11:17 Luis Carlos Cruz Carballo < [email protected]> wrote:

@daveyarwood https://github.com/daveyarwood we have to wait till maintainer link luajit instead of lua. Now I am using appimage from github

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/norcalli/nvim-colorizer.lua/issues/30?email_source=notifications&email_token=AACILK36DKU6WK577OHD2HDQ6CXDPA5CNFSM4JRCZOVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJFGVLA#issuecomment-575302316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACILK6KOFRX5J4PRQ3IS2TQ6CXDPANCNFSM4JRCZOVA .

-- Thank you, Ashkan Kiani

norcalli avatar Jan 16 '20 19:01 norcalli

That sounds awesome! It would be much appreciated; nvim-colorizer.lua looks really cool and I'd love to try it.

daveyarwood avatar Jan 16 '20 19:01 daveyarwood

In case anyone is interested, I have found a simple check one can do before setting up colorizer:

lua <<
if jit ~= nil then
    require'colorizer'.setup()
end
.

I had to do something similar with completion-nvim:

augroup completion-nvim
    autocmd!
    autocmd BufEnter * lua if jit ~= nil then require'completion'.on_attach() end
augroup end

since it was giving me a similar error due to the lack of linked luajit support in the neovim unstable ubuntu ppa.

This check was useful to me since I like to use the same config files across different systems (as many of you probably do), while not wanting things to break but at the same time, try to use a feature if possible.

ruifm avatar Apr 27 '20 12:04 ruifm