diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-20 23:41:53 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-20 23:41:53 -0400 |
| commit | cfddae42f59eacbd792a8853be089f4711bbf4ba (patch) | |
| tree | 9033de9a43822a63544244559380729b8f3d84bf /scratch/simplest_test.lua | |
| parent | 96cac0a8c861d5cdb1bb7765cc2d20e47ebb7885 (diff) | |
WIP: Actually get the UI to work and add some tests
Diffstat (limited to 'scratch/simplest_test.lua')
| -rw-r--r-- | scratch/simplest_test.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scratch/simplest_test.lua b/scratch/simplest_test.lua new file mode 100644 index 0000000..be7a4fb --- /dev/null +++ b/scratch/simplest_test.lua @@ -0,0 +1,31 @@ +require('plenary.reload').reload_module('telescope') + +local telescope = require('telescope') + +-- What is a finder? +-- Finders return a list of stuff that you want to fuzzy look through. +-- Finders can be static or not. +-- Static finders just return a list that never changes +-- Otherwise they return a new list on each input, you should handle them async. +local file_finder = telescope.finders.new { + static = true, + + fn_command = function() return 'git ls-files' end, +} + +local file_previewer = telescope.previewers.vim_buffer_or_bat + +local file_picker = telescope.pickers.new { + previewer = file_previewer +} + +local file_sorter = telescope.sorters.get_ngram_sorter() +-- local file_sorter = require('telescope.sorters').get_levenshtein_sorter() + +file_picker:find { + prompt = 'Simple File', + finder = file_finder, + sorter = file_sorter, +} + +local x = function() end |
