Skip to content

How to display hidden files and hidden folders in different colors #2113

Answered by hankertrix
Xiaomony asked this question in 1. Q&A
Discussion options

You must be logged in to vote

In your theme.toml file, copy Yazi's default file type configuration from here.

Add a rule like { name = "*", is = "hidden", bg = "cyan"} to the top of rules. Here's an example:

[filetype]

rules = [
    # Images
    { mime = "image/*", fg = "yellow" },

    # Media
    { mime = "{audio,video}/*", fg = "magenta" },

    # Archives
    { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "red" },

    # Documents
    { mime = "application/{pdf,doc,rtf}", fg = "cyan" },

    # Empty files
    # { mime = "inode/empty", fg = "red" },

    #############################################
    # Add the 2 lines below
    # Hidden files
    { name

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@martinengelke
Comment options

Answer selected by Xiaomony
Comment options

You must be logged in to vote
1 reply
@hankertrix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
3 participants