0

I load a plugin, and the plug docs tell me that I can configure it using lua code like this, which I might put in my startup file:

lua require('plugin_name').setup{
                              \ foo = true,
                              \ bar = { x = y },
                              \ baz = { z = { 'a', 'b' },
}

Suppose I want to see what these values are while nvim is running. I know that I can use :lua print(...) to display variables, and I think I might even need :lua print(vim.inspect(...)). Answers to this question and this question would help me if I knew what variable I was trying do inspect.

My question is: Given what I know from the plugin documentation (as shown in the code block above), what substitute for ...? What are the names of the lua variables and tables that are implied by the above setup code?

2
  • 1
    Unfortunately, because setup is usually a function it could be anything. Your best bet is probably to open whatever file defines the setup function and glance at it.
    – D. Ben Knoble
    Mar 16 at 19:23
  • Thanks @D.BenKnoble. Then that's the answer. Feel free to copy what you wrote into an answer, and I'll accept it.
    – Mars
    Mar 16 at 23:30

1 Answer 1

1

Unfortunately, because setup is usually a function it could be anything. Your best bet is probably to open whatever file defines the setup function and glance at it.

There’s no standard, really, although I would expect lots of the equivalent of g:<plugin>_<var>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.