Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Filter files (e.g. according to file extension) #588

Open
1 task done
FrancisH-C opened this issue Feb 22, 2025 · 0 comments
Open
1 task done

feature request: Filter files (e.g. according to file extension) #588

FrancisH-C opened this issue Feb 22, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@FrancisH-C
Copy link

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

I'd like a way to filter and show files with a given file extension.

Provide background

I wanted to sort file according to file extension as in #224.
Filtering files is, for me (and maybe others), a good alternative. It seems easier to implement.

What is the significance of this feature?

nice to have

Additional details

Being new to lua, my current solution is to have a keybinding to do

function()
  local oil = require("oil")
  local filter = vim.fn.input("Fitler")

  local is_hidden_file = function(name, bufnr)
    local m = name:match(filter)
    return m ~= nil
  end

  -- Set the custom function to determine if a file is hidden
  oil.set_is_hidden_file(is_hidden_file)
end

I'd like an "official" way of doing it with the following "constraint":

  1. Easy to toggle on and off
  2. toggle_hidden should not be affect by the filter (at least when turned off)
  3. Specify files to show not the ones to hide

Thank you for Oil

@FrancisH-C FrancisH-C added the enhancement New feature or request label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant