Skip to content

Allow custom highlighting for different files/directories #1790

@kennykaye

Description

@kennykaye

Contributing guidelines

Module(s)

mini.files

Description

I would like to add support for user-defined highlighting inside mini.files. This would allow for users to define something like:

require("mini.files").setup({
  content = {
    highlight = function(fs_entry)
      if fs_entry.fs_type == 'file' then
        if vim.startswith(fs_entry.name, '.') then
          return 'MiniFilesHidden'
        end
      end
      return nil
    end,
  }
})

Resulting in:

Image

Here is a draft implementation. If this is something you would be interested in, I could move this against the main project.

Alternatives considered:

  • Adding hardcoded support for a MiniFilesHidden highlight group

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions