Skip to content

How to chain fzf commands? #1237

Answered by ibhagwan
elenapan asked this question in Q&A
Jun 7, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hi @elenapan, what an honor for you to be interested in my project, to this day I still use a color scheme for my terminal from one of your customizations :)

As for your question, fzf-lua is async and runs in a lua coroutine so you can’t chain the commands the way you tried, you need to create a custom action, see:
https://github.com/ibhagwan/fzf-lua/wiki/Advanced#fzf-exec-acts

fzf.fzf_exec(project_list, {
  actions = {
    ['default'] = {
      fn = function(sel, opts)
        fzf.files({ cwd = sel[1] })
      end,
      -- we use `noclose` to reuse the existing floating windows
      -- it will work regardless but you’ll see the windows “flash”
      noclose = 1,
    },
    -- anything …

Replies: 1 comment 3 replies

Comment options

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

@AlejandroSanchez90
Comment options

@ibhagwan
Comment options

Answer selected by elenapan
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