Skip to content
Discussion options

You must be logged in to vote

There might be an easier way to do this, but this is the first one that comes to my mind.

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system 'curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua')()

---@module 'snacks'

-- https://github.com/folke/snacks.nvim/blob/main/lua/snacks/picker/select.lua

---@class LayoutOpt: snacks.picker.layout.Config
---@field layout? snacks.layout.Box

---@generic T
---@param items T[] Arbitrary items
---@param opts? {prompt?: string, format_item?: (fun(item: T): string), layout?: LayoutOpt, kind?: string}
---@param on_choice fun(item?: T, idx?: number)
local picker_select = function(items, opts, on_choice)
  assert(type(on_choice) == '

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
6 replies
@A7Lavinraj
Comment options

@A7Lavinraj
Comment options

@A7Lavinraj
Comment options

@drowning-cat
Comment options

Answer selected by A7Lavinraj
@A7Lavinraj
Comment options

Comment options

You must be logged in to vote
2 replies
@drowning-cat
Comment options

@sugvn
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants