summaryrefslogtreecommitdiff
path: root/scratch
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-08-31 16:44:47 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-08-31 17:32:31 -0400
commite38589f265a276d431113efcef6fdb157120ce68 (patch)
treebd3203a976f3e349875184f03d3199d79fb7303f /scratch
parent0af8a911b4b5d3eefa6518a804ddadefefd65e19 (diff)
feat: Combine configuration into picker.new()
Diffstat (limited to 'scratch')
-rw-r--r--scratch/rocker_example.lua24
1 files changed, 24 insertions, 0 deletions
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