summaryrefslogtreecommitdiff
path: root/scratch/simplest_test.lua
blob: be7a4fb16c87eca1162dde5d1c7a88dc2831430b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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