How to alias config in packer.startup{}
#443
Answered
by
wbthomason
bangedorrunt
asked this question in
Q&A
-
This is my setup which is not working atm return require 'packer'.startup {
function()
local config = function(name)
pcall(require, 'plugins.' .. name)
end
-- Didn't work!
use { 'foo', config = config 'foo' }
end
} FYI, |
Beta Was this translation helpful? Give feedback.
Answered by
wbthomason
Jul 4, 2021
Replies: 1 comment 1 reply
-
Right now, your config is passing the result of the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bangedorrunt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, your config is passing the result of the
pcall
to theconfig
key. You want your config function to return a function that callspcall
as desired. However, you might run into trouble with this becausestring.dump
does not allow upvalues. #402 will fix that shortcoming, or you can just have your config function return a string instead (which will be inserted verbatim).