Skip to content
Discussion options

You must be logged in to vote

Either manually or create a custom picker for the fuzzy finder you use to do this. I use fzf-lua and have the following custom picker

local fzf = require("fzf-lua")
local utils = require("fzf-lua.utils")

local function hl_validate(hl)
  return not utils.is_hl_cleared(hl) and hl or nil
end

local function ansi_from_hl(hl, s)
  return utils.ansi_from_hl(hl_validate(hl), s)
end

function M.scratch_buffers()
  local entries = {}
  local items = Snacks.scratch.list()
  local item_map = {}

  for _, item in ipairs(items) do
    item.icon = item.icon or Snacks.util.icon(item.ft, "filetype")
    item.branch = item.branch and ("branch:%s"):format(item.branch) or ""
    item.cwd = item.cwd and vim.fn

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@vinicius507
Comment options

Answer selected by vinicius507
Comment options

You must be logged in to vote
1 reply
@dpetka2001
Comment options

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