Skip to content

Toggle between git_files and files? #1956

Answered by nenahp
mdjohns asked this question in Q&A
Discussion options

You must be logged in to vote
local function toggle_git_files()
  require('fzf-lua').files({
    actions = {
      ['ctrl-g'] = {
        fn = function()
          require('fzf-lua').git_files({
            actions = { ['ctrl-g'] = { fn = toggle_git_files, exec_silent = true } },
          })
        end,
        exec_silent = true,
      },
    },
  })
end
toggle_git_files()

Actually this can be achieved by ["ctrl-g"] = require('fzf-lua').actions.toggle_ignore. The default binding is alt-i

Replies: 1 comment

Comment options

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