feat: Combine configuration into picker.new()

This commit is contained in:
TJ DeVries
2020-08-31 16:44:47 -04:00
parent 0af8a911b4
commit e38589f265
6 changed files with 298 additions and 309 deletions

View File

@@ -0,0 +1,24 @@
builtin.git_files = function(opts)
opts = opts or {}
opts.show_preview = get_default(opts.show_preview, true)
opts.finder = opts.finder or finders.new {
static = true,
fn_command = function()
return {
command = 'git',
args = {'ls-files'}
}
end,
}
opts.prompt = opts.prompt or 'Simple File'
opts.previewer = opts.previewer or previewers.cat
opts.sorter = opts.sorter or sorters.get_norcalli_sorter()
pickers.new(opts):find()
end