Avoid creating special-purpose configuration options when simpler alternatives exist. Don't force users to call setup functions or provide explicit configuration for basic functionality to work.
Avoid creating special-purpose configuration options when simpler alternatives exist. Don’t force users to call setup functions or provide explicit configuration for basic functionality to work.
As noted in the discussions: “special-purpose options are clumsy and a maintenance burden” and “users will be forced to call this function in order to use your plugin, even if they are happy with the default configuration.”
Instead of creating configuration options, consider:
Example of what to avoid:
-- Don't force this pattern
vim.g.query_autoreload_on = { 'InsertLeave', 'TextChanged' }
-- Instead, document the underlying mechanism
vim.api.nvim_create_autocmd('BufWritePost', {
pattern = '*.scm',
callback = function() vim.treesitter.query.invalidate_cache() end
})
For operations that require user consent (like network downloads), provide confirmation prompts rather than configuration flags. This maintains security while avoiding configuration complexity.
Enter the URL of a public GitHub repository