kosayoda / nvim-lightbulb

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

Add automatic autocmd creation to config #35

Closed yochem closed 2 years ago

yochem commented 2 years ago

This PR adds the default configuration for the autocmd config, a function that creates the augroup "LightBulb" and adds an autocmd to this group. This function is called in config.setup if default_config.autocmd.enabled is set to true.

I chose to use the keyword pattern instead of patterns to make it the same as the nvim API for autocmds.

Closes #32.

yochem commented 2 years ago

I tried to keep the code style as similar as possible. LMK if you want me to do something differently!

kosayoda commented 2 years ago

Thanks for the PR! I'll try to take a closer look as soon as possible, as I am fairly busy recently. On first glance, do you happen to know when vim.api.nvim_create_autocmd and vim.api.nvim_create_augroup were added?

yochem commented 2 years ago

It was added in the latest stable release: v0.7.0. This version is released 23 days ago. I could add in a check to support older versions as well if you want. I see I also forgot to update the readme to include information about this option. Will do that too.

yochem commented 2 years ago

Done!

kosayoda commented 2 years ago

Thanks for the PR!