kosayoda / nvim-lightbulb

VSCode 💡 for neovim's built-in LSP.
MIT License
801 stars 30 forks source link

Allow users to specify defaults #26

Closed sebastianvera closed 2 years ago

sebastianvera commented 2 years ago

This PR attempts to fix #2 by adding a setup function, the same pattern as other plugins are using, like telescope, octo.nvim, among others.

I couldn't find a better example for "Per-call" configuration in the README file, so I'll be happy to update it if you have a better use case!

I was wondering also if adding a sample snippet on how to configure it with packer or other plugin managers will be useful, i.e:

use {
  "kosayoda/nvim-lightbulb",
  config = function()
    require'nvim-lightbulb'.setup({
      ignore = {"null-ls"},
    })

    vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]]
  end,
}

Thank you!

kosayoda commented 2 years ago

Thanks for the PR!

I couldn't find a better example for "Per-call" configuration in the README file

The one you have looks good to me.

I was wondering also if adding a sample snippet on how to configure it with packer or other plugin managers will be useful

I was lukewarm on the idea when it was just had per-call configuration, but now with two different ways to configure the handler, it might be a good idea. I'd be happy to accept a PR adding such a snippet.