Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created December 18, 2021 18:36
Show Gist options
  • Save LinArcX/f8b4f654227a95019b1c4f42e1387ee9 to your computer and use it in GitHub Desktop.
Save LinArcX/f8b4f654227a95019b1c4f42e1387ee9 to your computer and use it in GitHub Desktop.
categories = function(opts)
opts = opts or {}
pickers.new(opts, {
prompt_title = "categories",
layout_strategy = "vertical",
layout_config = { anchor="N"},
finder = finders.new_table {
results = {"foo", "bar"}
},
sorter = conf.generic_sorter(opts),
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
print(vim.inspect(selection))
end)
return true
end,
}):find()
end
categories()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment