Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Telescope Extension One Shot Jobs For External Commands

Code

local pickers = require "telescope.pickers"
local finders = require "telescope.finders"

local run_search = function(opts)
  opts = opts or {}
  if next(opts) == nil then
    -- TODO: Figure out how to do a "not" check
  else
   require('notify')(opts)
  end
  pickers.new(opts, {
    prompt_title = "grimoire",
    finder = finders.new_oneshot_job({ 'echo', 'here' })
  }):find()
end

return require("telescope").register_extension {
  exports = {
    grimoire = run_search
  },
}