yazi/Q/Is there a way to make yazi display files differently based on the gitignore status?
Is there a way to make yazi display files differently based on the gitignore status?
AI Answer
- AI/Response
- Short answer: Yes — via the official
git.yaziplugin from the yazi-rs/plugins repository, which adds per-file git status badges including a distinct style for gitignored files. - Install the plugin:
- Register fetchers in
~/.config/yazi/yazi.toml: - Initialize in
~/.config/yazi/init.lua: - The plugin runs
git status --porcelain --ignored=matchingand displays a badge next to each file. Gitignored files get adarkgrayforeground by default (via the!!porcelain prefix). - Customize the ignored-file appearance in
~/.config/yazi/theme.toml: - Caveat — fd hides gitignored files by default: yazi uses
fdfor directory listing andfditself respects.gitignore, so gitignored files won't appear in the listing at all unless you configure yazi to show them. There is no built-inshow_gitignoredtoggle; the workaround is to pass--no-ignoretofdvia manager config or to accept that the badge only shows up on files fd does list. See issue #1655 for context (closed as not planned). - Sources: git.yazi plugin README, issue #1655
- Short answer: Yes — via the official
- AI/Response