I'm trying to customize a plugin and I want to know if there's a way to just set a single option without calling setup, or to change an option after setup has been called.
local actions = require('telescope.actions')
local telescope = require('telescope')
telescope.setup{
pickers = {
find_files = {
hidden = true,
find_command = {
'rg',
'--color=never',
'--files',
'--no-ignore',
'--iglob',
'!.git',
'--iglob',
'!node_modules/**/*',
'--iglob',
'!.idea/',
'--iglob',
'!dist/'
}
}
},
defaults = {
mappings = {
i = {
["<A-j>"] = function () actions.move_selection_next(vim.api.nvim_get_current_buf()) end,
["<A-k>"] = function () actions.move_selection_previous(vim.api.nvim_get_current_buf()) end
}
},
vimgrep_arguments = {
'rg',
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
'--smart-case',
'--iglob',
'!.git',
'--iglob',
'!node_modules/**/*',
'--iglob',
'!.idea/',
'--iglob',
'!dist/',
'-u'
},
}
}
telescope.load_extension('projects')
Is there an way to change the find_files setting, ideally using lua, without calling setup again? A use case would be changing a single setting if a certain file is opened.
setup
function, which happens (?) to be a convention, not a requirement. So for each plugin you would need to find out what is available to dynamically adjust any settings.