summaryrefslogtreecommitdiff
path: root/scratch/simple_rg.lua
blob: 5102611910cc77b993c5ed472b4f9f5e466bf8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local telescope = require('telescope')

-- Uhh, finder should probably just GET the results
-- and then update some table.
-- When updating the table, we should call filter on those items
-- and then only display ones that pass the filter
local rg_finder = telescope.finders.new {
  fn_command = function(self, prompt)
    return string.format('rg --vimgrep %s', prompt)
  end,

  responsive = false
}

local p = telescope.pickers.new {
  previewer = telescope.previewers.vim_buffer
}
p:find {
  prompt = 'grep',
  finder = rg_finder
}