Repository: LazyVim/LazyVim
File: lua/lazyvim/plugins/extras/editor/fzf.lua (Lua)

Code before:
      end
      builtin = "git_files"
    end

    return require("fzf-lua")[builtin](opts)
  end
end

return {
  {
    "nvim-telescope/telescope.nvim",
    enabled = true,
    keys = function()
      return {}
    end,
  },
  {
    "ibhagwan/fzf-lua",
    event = "VeryLazy",
    opts = {
      [1] = "default-title",
      keymap = {
        fzf = {
          ["ctrl-q"] = "select-all+accept",
        },
      },
      fzf_colors = {
        ["fg"] = { "fg", "FzfLuaNormal" },
        ["bg"] = { "bg", "FzfLuaNormal" },
        ["hl"] = { "fg", "Special" },
        ["fg+"] = { "fg", "Visual" },
        ["bg+"] = { "bg", "Visual" },
        ["hl+"] = { "fg", "Special" },
        ["info"] = { "fg", "NonText" },
        ["border"] = { "fg", "FzfLuaBorder" },
        ["gutter"] = { "bg", "FzfLuaNormal" },
        ["query"] = { "fg", "FzfLuaNormal" },
        ["prompt"] = { "fg", "FzfLuaNormal" },
        ["pointer"] = { "fg", "FzfLuaMarker" },
        ["marker"] = { "fg", "FzfLuaMarker" },
        ["header"] = { "fg", "FzfLuaNormal" },
      },
    },
    config = function(_, opts)
      if opts.profile then
        opts[1] = opts.profile
        -- require("fzf-lua").setup({ opts.profile })
        -- opts.profile = nil
      end
      -- vim.env.FZF_DEFAULT_OPTS = ""
      require("fzf-lua").setup(opts)

Review comment (suggestion):
@folke Just a suggestion. By doing that you overwrite all the default keymaps as also mentioned in the [docs](https://github.com/ibhagwan/fzf-lua/blob/9ecc8f6a6555cd3988c21480069aa5da001cd9df/README.md?plain=1#L606-L609). If you don't intend to do this, then take a look at my [dots](https://github.com/dpetka2001/dotfiles/blob/a95a1cb3650c7e8a9f138b2067d1f4a544d7de88/dot_config/nvim/lua/plugins/editor.lua#L170-L200) for alternatives how to not completely overwrite them. My dots only explore a primitive testing of `fzf-lua`, as I haven't fully transitioned to it yet.

Code after:
end

return {
  {
    "nvim-telescope/telescope.nvim",
    enabled = false,
  },
  {
    "ibhagwan/fzf-lua",
    event = "VeryLazy",
    opts = function(_, opts)
      local config = require("fzf-lua.config")
      local actions = require("fzf-lua.actions")

      -- Quickfix
      config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept"
      config.defaults.keymap.builtin["<c-f>"] = "preview-page-down"
      config.defaults.keymap.builtin["<c-b>"] = "preview-page-up"

      -- Trouble
      config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open

      -- Toggle root dir / cwd
      config.defaults.actions.files["ctrl-r"] = function(_, ctx)
        local o = vim.deepcopy(ctx.__call_opts)
        o.root = o.root == false
        o.cwd = nil
        o.buf = ctx.__CTX.bufnr
        LazyVim.pick.open(ctx.__INFO.cmd, o)
      end
      config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"]

      -- use the same prompt for all
      local defaults = require("fzf-lua.profiles.default-title")
      local function fix(t)
        t.prompt = t.prompt ~= nil and " " or nil
        for _, v in pairs(t) do
          if type(v) == "table" then
            fix(v)
          end
        end
      end
      fix(defaults)

      vim.api.nvim_set_hl(0, "FzfLuaPath", { link = "Directory", default = true })

      return vim.tbl_deep_extend("force", opts, defaults, {
        fzf_colors = true,
        files = {
          cwd_prompt = false,
          actions = {