Hello, I am having a problem where the config key doesn't work when the plugin also has the after key.
I am trying to:
lightline and create a global vim variable with the configuration.This is the minimal configuration to test this:
vim.cmd [[ packadd packer.nvim ]]
return require'packer'.startup(function()
use { 'wbthomason/packer.nvim', opt = true }
use {
'itchyny/lightline.vim',
config = function() vim.cmd [[ echom 'lightline.vim' ]] end,
}
use {
'bluz71/vim-nightfly-guicolors',
after = 'lightline.vim',
config = function() vim.cmd [[ echom 'colorscheme.vim' ]] end,
}
end)
When you type :messages the output is:
lightline.vim
colorscheme.vim
When you type :messages the output is:
lightline.vim
colorscheme.vim doesn't appear at all.
Note: the setup key works but the config key doesn't.
Also, it would be useful to document how to use the after key; I coudn't find anything.
Thanks for the report! This is indeed a bug in lazy-loader compilation. I'm working on a fix now.
Also, the current only documentation of the after key is the line in the big code block in https://github.com/wbthomason/packer.nvim#specifying-plugins (and the corresponding block in the docs/). What information do you think it would help to add?
Also, the semantics of after will be changing soon :tm:, per #87 and friends.
What information do you think it would help to add?
I think it would be helpful to add how to specify the plugin.
Like, for example, if you specify lightline as itchyny/lightline.vim or as lightline.vim. And if the as key works as an alias with after.
Ah, excellent points. I'll add some quick notes.
Also, please let me know if you continue to experience the original bug.
It works perfectly without the as to create an alias, but with as it gives me this error:
Error detected while processing /home/datwaft/.config/nvim/plugin/packer_compiled.vim:
line 179:
E5107: Error loading lua [string ":lua"]:165: unexpected symbol near 'char(27)'
E5108: Error executing lua .../site/pack/packer/opt/packer.nvim/lua/packer/compile.lua:360: attempt to index a nil value
Here is an extract of my configuration:
use {
'sainnhe/edge',
config = require'plugins.colorscheme',
as = 'colorscheme',
}
use {
'itchyny/lightline.vim',
config = require'plugins.lightline',
after = 'colorscheme',
}
Ah, my bad - should be fixed in 242773d. Thanks for your patience!
The index value error seems to be fixed, but the other one continues:
Error detected while processing /home/datwaft/.config/nvim/plugin/packer_compiled.vim:
line 179:
E5107: Error loading lua [string ":lua"]:165: unexpected symbol near 'char(27)'
Screenshot

Hmm, that one I cannot reproduce. I suspect this may be an error with your plugins.colorscheme or plugins.lightline modules, since that's the one part of your config that I didn't directly replicate. Do either of those functions contain upvalues? Due to the limitations of Lua's string.dump, functions passed to config and setup cannot use upvalues (this is hopefully getting worked around soonish).
Strangely, I commented the lines for plugins.colorscheme and plugins.lightline and the uncommented them and it works.
And when copying the configuration to Debian from Ubuntu it doesn't work. It seems to be an error from my side.
Thanks!
I think it was the old packer_compiled.vim that was giving me problems. After deleting it and compiling it again it works!
Ah, got it. Glad to hear it's working now!