Skip to content

Workspace based workflow with mini.pick? #1453

Answered by AmerM137
AmerM137 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the info, the snippet below works.

MiniPick.registry.projects = function()
  local cwd = vim.fn.expand('~/stdlib')
  local choose = function(item)
    vim.schedule(function() MiniPick.builtin.files(nil, { source = { cwd = item.path } }) end)
  end
  return MiniExtra.pickers.explorer({ cwd = cwd }, { source = { choose = choose } })
end

This allows me to pick between different directories under '~/stdlib' then launch a files picker after for that directory.

question: if I replace the return statement with the following, I end up in my current directory, why is that? I copied your version out of curiosity.

return MiniPick.builtin.files({ cwd = cwd }, { source = { choose = choose } })

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AmerM137
Comment options

Answer selected by echasnovski
@echasnovski
Comment options

@AmerM137
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.pick mini.extra
2 participants