norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.25k stars 117 forks source link

Need of Luajit, steps to install it #30

Open carlitux opened 4 years ago

carlitux commented 4 years ago

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

norcalli commented 4 years ago

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.

carlitux commented 4 years ago

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

norcalli commented 4 years ago

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.

daveyarwood commented 4 years ago

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 commented 4 years ago

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.

carlitux commented 4 years ago

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

norcalli commented 4 years ago

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 < notifications@github.com> 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

daveyarwood commented 4 years ago

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

ruifm commented 4 years ago

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.