nvim-telescope / telescope-frecency.nvim

A telescope.nvim extension that offers intelligent prioritization when selecting files from your editing history.
MIT License
773 stars 37 forks source link

[Feature request] ignore_pattern accept function #187

Closed Song-Tianxiang closed 2 months ago

Song-Tianxiang commented 6 months ago

I want to ignore files that have set nobuflisted. How can I achieve this? Can we make ignore_pattern accept a function and give user more control.

delphinus commented 6 months ago

Nice idea. We can ignore any file not to register into DB as we like. I will implement it.

delphinus commented 2 months ago

I added ignore_register option to achieve this. For example, you can ignore to register files that is 'nobuflisted'.


telescope.setup {
  extensions = {
    frecency = {
      ignore_register = function(bufnr)
        return not vim.bo[bufnr].buflisted
      end,
    }
  },
}