Skip to content

filesystem_watchers.ignore_dirs and git.disable_for_dirs functions #2799

Closed
@alex-courtis

Description

@alex-courtis

Can this functionality be implemented utilising API?
no, static config

Is your feature request related to a problem? Please describe.
Ignore directories based on dynamic conditions.

Describe the solution you'd like
filesystem_watchers.ignore_dirs and git.disable_for_dirs can be fun(string): boolean where string is the absolute path of the directory.

Describe alternatives you've considered
Setting dirs dynamically before setup.

Additional context
Use case:

local IGNORE_PATHS = {
  vim.env.HOME .. "/src/nvim-tree/r/dyn/foo",
  vim.env.HOME .. "/src/nvim-tree/r/dyn/bar",
}
local function ignore_path(path)
  for _, p in ipairs(IGNORE_PATHS) do
    if path:find(p, 1, true) == 1 then
      return true
    end
  end
  return false
end

foo/master, foo/worktree1 and bar repos will return false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions