Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtimepath issue, colorizer.lua not found. #26

Closed
bluz71 opened this issue Nov 5, 2019 · 4 comments
Closed

runtimepath issue, colorizer.lua not found. #26

bluz71 opened this issue Nov 5, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bluz71
Copy link

bluz71 commented Nov 5, 2019

Hello,

I have an ~/.config/nvim/init.vim with the following content:

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

I do that since I want to share ~/.vimrc between Vim and Neovim.

In ~/.vimrc I have:

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')

if has("nvim")
Plug 'norcalli/nvim-colorizer.lua'
lua require'colorizer'.setup()
endif

call plug#end()

With that configuation, Neovim is failing to start with the following error:

no field package.preload['colorizer']
no file '/Users/bluz71/.vim/lua/colorizer.lua'
no file '/Users/bluz71/.vim/lua/colorizer/init.lua'
no file '/Users/bluz71/.config/nvim/lua/colorizer.lua'
no file '/Users/bluz71/.config/nvim/lua/colorizer/init.lua'
no file '/Users/bluz71/.local/share/nvim/site/lua/colorizer.lua'
no file '/Users/bluz71/.local/share/nvim/site/lua/colorizer/init.lua'

Ideally it should try and lookup /Users/bluz71/.vim/plugged/nvim-colorizer.lua/lua/colorizer.lua.

The &rtp does contain the path component /Users/bluz71/.vim/plugged/nvim-colorizer.lua/.

Is there something you should be doing at your end to extend lookup? Or is there something I need to do at my end?

Cheers.

@bluz71 bluz71 added the bug Something isn't working label Nov 5, 2019
@norcalli
Copy link
Owner

norcalli commented Nov 5, 2019

Put require 'colorizer.setup() after plug#end()

@norcalli norcalli closed this as completed Nov 5, 2019
@bluz71
Copy link
Author

bluz71 commented Nov 5, 2019

Thanks.

@NilsIrl
Copy link

NilsIrl commented Dec 29, 2019

I'm using vim's buitin package loader feature and it doesn't work.

packages seems to be loaded after the vimrc. (Which does make sense because other packages need the values set in the vimrc when they are loaded.)

The solution for me is to set nvim-colorizer.lua as an optional package (that needs to be manually loaded) and load it (using packadd) before calling lua require 'colorizer'.setup()

@skbolton
Copy link

The solution for me is to set nvim-colorizer.lua as an optional package (that needs to be manually loaded) and load it before calling lua require 'colorizer'.setup()

Thanks for this I was running into the same issue and this fixed it! @norcalli I am not good with the lua stuff in neovim - is there a way to lua require that would also look into the &packpath?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants