From e38589f265a276d431113efcef6fdb157120ce68 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 31 Aug 2020 16:44:47 -0400 Subject: feat: Combine configuration into picker.new() --- scratch/rocker_example.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scratch/rocker_example.lua (limited to 'scratch/rocker_example.lua') diff --git a/scratch/rocker_example.lua b/scratch/rocker_example.lua new file mode 100644 index 0000000..0e73114 --- /dev/null +++ b/scratch/rocker_example.lua @@ -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 -- cgit v1.2.3