- 
                Notifications
    
You must be signed in to change notification settings  - Fork 637
 
feat: folder-specific file exclusion rules #3266
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
base: main
Are you sure you want to change the base?
Conversation
| 
           The companion documentation PR has been updated at yazi-rs/yazi-rs.github.io#294  | 
    
671e952    to
    6107a47      
    Compare
  
    | 
           Hi @sxyazi ... any news on this? :)  | 
    
| show_hidden = false | ||
| show_symlink = true | ||
| scrolloff = 5 | ||
| mouse_events = [ "click", "scroll" ] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the file the original style
| @@ -1,44 +1,46 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the file the original style
| @@ -1,58 +1,86 @@ | |||
| [workspace] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the file the original style
        
          
                yazi-fs/src/ignore.rs
              
                Outdated
          
        
      | pub fn from_dir( | ||
| dir: impl AsRef<Path>, | ||
| exclude_patterns: &[String], | ||
| use_git: bool, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove use_git - as said in #3257 (comment), there are no plans to build gitignore support in, to reduce complexity and maintenance costs, instead, provide a command or Lua API to allow users to load any external ignore rules at runtime, possibly as a fetcher.
        
          
                yazi-config/src/files/exclude.rs
              
                Outdated
          
        
      | #[serde(rename = "in")] | ||
| pub context: String, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #[serde(rename = "in")] | |
| pub context: String, | |
| pub r#in: String, | 
Please use a raw identifier instead
| 
           Hi guys, I was trying out the branch on the current state and it works well. I was wondering; if this option is removed Then the objective would be to delegate the .gitignore responsibility to a plugin? Honestly, I think the way it's currently implemented is the right move, because from a user perspective, that was the only thing that I thought that yazi lacked, hiding git ignore files. I just want to advocate to refine the PR as requested by @sxyazi but keep the git ignore feature builtin. I know it is maintenance cost and I don't want to sound entitled, but I think it's a really useful feature when using yazi on Helix or Neovim, for example. I'd involve myself in the process but I simply lack the Rust skills to do so at the moment. Thanks btw  | 
    
| 
           I agree with @and-rs and think the addition of gitignore only bring gains and ease the burden of big part of the user base with almost no effort.  | 
    
| 
           Yes, I plan to implement it as a plugin. I don't really see the problem with implementing it as a plugin, because from the user's perspective, you just need to install it and simply enable it to start using it, just like the existing  If installing plugins is a challenge, we can also bundle it in, distributing it to users as a preset plugin just like all other Yazi preset plugins, the user would just need to enable it, and the experience would be no different from having it implemented in Rust. However, it's best to maintain it in a separate repository at first, so it isn't tied to Yazi's release cycle and can get bug fixes more promptly - in Yazi, plugins are first-class citizens, and most features are provided through plugins from the inside out. Technically, loading and parsing gitignore files involves IO operations, so it should be implemented as a fetcher in an asynchronous way to avoid blocking the main thread (the current implementation is synchronous). In Yazi, all IO operations are and should be asynchronous, and fetchers exist for exactly this purpose: they load external information and transform sync into async, but fetchers are built around Lua and can only exist as plugins - there is no equivalent infrastructure available in Rust. It could also be maintained as a community fork if "implemented in Rust" is a concern here - not all features need to be upstreamed, and I encourage users to maintain their forks to fit their own needs, and I can link these forks in the documentation so others interested in the future can use or help maintain them.  | 
    
- Introduced `Ignore` actor to manage ignore patterns based on gitignore and user-defined overrides. - Implemented `IgnoreFilter` to handle ignored paths and patterns. - Updated `Files` struct to include an ignore filter, allowing files to be filtered based on ignore rules. - Modified existing actors and managers to apply ignore filters during file operations. - Updated `Cargo.toml` and `Cargo.lock` to include new dependencies related to ignore functionality.
| 
           I'm looking into reverting the gitignore config. Which tool is used for toml formatting as taplo automatically formats it as now.  | 
    
| 
           Don't format the toml files, only add or modify necessary parts 
…On Wed, Oct 29, 2025 at 6:54 AM Carlos Eduardo ***@***.***> wrote:
 *carlosedp* left a comment (sxyazi/yazi#3266)
 <#3266 (comment)>
 I'm looking into reverting the gitignore config. Which tool is used for
 toml formatting as taplo automatically formats it as now.
 —
 Reply to this email directly, view it on GitHub
 <#3266 (comment)>, or
 unsubscribe
 <https://github.com/notifications/unsubscribe-auth/AEFWFICAAE4YKKT75PZGJSL3Z7X3PAVCNFSM6AAAAACJW2BN42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINJYHA3TINRZGE>
 .
 You are receiving this because you were mentioned.Message ID:
 ***@***.***>
 
 | 
    
| 
           Just pushed the changes.  | 
    
| 
           Hold the review a bit. I'll push a commit later today which adds API to allow the use of exclusion by plugins and also the lua plugin to load gitignore files from repos.  | 
    
…xclude patterns externally
| 
           The latest commit adds the API allowing Lua plugins to add exclude patterns to the processing. Patterns from  As a companion, I've created the   | 
    
| 
           Btw @and-rs ... if you can test this out with the plugin I'd love to get some feedback... :)  | 
    
| 
           I'm already looking into this... Facing a problem when e browsing a git repo subdir and going back... Something about yazi caching the repo and not calling the fetcher to update the files. This brief "flashing" you see is normal since the fetcher is async and when opening a dir the file is shown until the plugin returns and yazi hides it. Tips @sxyazi ?  | 
    
| 
           Any reason to fetch multiple times? For better performance, Yazi marks
files that have already been fetched as no longer needing to be fetched
again since that's a time-consuming operation unless there are changes to
those files 
…On Fri, Oct 31, 2025 at 8:54 AM Carlos Eduardo ***@***.***> wrote:
 *carlosedp* left a comment (sxyazi/yazi#3266)
 <#3266 (comment)>
 I'm already looking into this... Facing a problem when e tearing a git
 repo subdir and going back... Something about yazi caching the dirt and not
 calling the fetcher to update the files.
 This brief "flashing" you see is normal since the fetcher is async and
 when opening a dir the file is shown until the plugin returns and yazi
 hides it.
 Tips @sxyazi <https://github.com/sxyazi> ?
 —
 Reply to this email directly, view it on GitHub
 <#3266 (comment)>, or
 unsubscribe
 <https://github.com/notifications/unsubscribe-auth/AEFWFIDV3N4FJPW566WP4C332KXNJAVCNFSM6AAAAACJW2BN42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZQHA3TONJTGM>
 .
 You are receiving this because you were mentioned.Message ID:
 ***@***.***>
 
 | 
    
| 
           Fixed the caching issue and updated the plugin as well since it had a pattern matching problem. Can you test this out @and-rs? It needs to pull and build this new commit and update the plugin from it's repo.  | 
    
| 
           @and-rs I override my config with yours and here it's working fine: Untitled.video.-.Made.with.Clipchamp.2.mp4I have git.yazi too and it's not working with the upstream main branch (not related to my changes)... I've noticed many other issues with nightly like some flavors (Dracula). Yatline plugin is broken too. Maybe @sxyazi can chime in about this and if there's a guide on deprecations so plugin owners fix them.  | 
    



This pull request introduces a file exclude system to the file manager, adding support for custom ignore patterns per path. It enables users to control which files and directories are hidden from view. The changes span configuration, core logic, and integration with the actor and file management systems. The PR also contemplates the API to support rules from Lua plugins which can be used to provide exclusions like gitignores.
Configuration and Integration
New [files] configuration to include
excludessettings, allowing users to specify custom ignore patterns.Sample configuration:
These changes collectively add robust and flexible ignore filtering, enhancing the file manager's ability to hide unwanted files and directories according to user preferences and project standards as explained in #3257 (comment).
There are companion PRs and repos to this PR: