Skip to content

how to make config and opts coexist in a plugin's setting file, if they can? #1248

Closed Answered by dpetka2001
hopezh asked this question in Q&A
Discussion options

You must be logged in to vote

That's because when you define a config function in your personal configuration, you're overwriting the default implementation that lazy.nvim uses. In that case, the user is responsible for calling the setup for the plugin and passing opts into it. Something like the following would be needed specifically for the config function to also take into account the opts

config = function(_, opts)
  require("telescope").setup(opts)
  -- rest of your code goes here
end

It would also be beneficial to you if you took advantage of the keys section for the plugin spec to define the keymaps that you want instead of defining them in the config function (this way you also ensure that the plugin will be l…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hopezh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants