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

Support icon color #1674

Merged
merged 5 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,8 @@ Icons are configured using `LF_ICONS` environment variable or an icons file (ref
The variable uses the same syntax as `LS_COLORS/LF_COLORS`.
Instead of colors, you should put a single characters as values of entries.
The `ln` entry supports the special value `target`, which will use the link target to select a icon. File name rules will still apply based on the link's name -- this mirrors GNU's `ls` and `dircolors` behavior.
The icons file (refer to the [CONFIGURATION section](https://github.com/gokcehan/lf/blob/master/doc.md#configuration)) should consist of whitespace-separated pairs with a `#` character to start comments until the end of the line.
The icons file (refer to the [CONFIGURATION section](https://github.com/gokcehan/lf/blob/master/doc.md#configuration)) should consist of whitespace-separated arrays with a `#` character to start comments until the end of the line.
Each line should contain 1-3 columns, first column is filetype or filename pattern, second column is the icon, third column is an optional icon color. If there is only one column, means to disable rule for this filetype or pattern.
Do not forget to add `set icons true` to your `lfrc` to see the icons.
Default values are as follows given with their matching order in lf:

Expand All @@ -1835,3 +1836,6 @@ Default values are as follows given with their matching order in lf:

A sample icons file can be found at
https://github.com/gokcehan/lf/blob/master/etc/icons.example

A sample colored icons file can be found at
https://github.com/gokcehan/lf/blob/master/etc/icons_colored.example
13 changes: 10 additions & 3 deletions doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2057,9 +2057,13 @@ special value target, which will use the link target to select a icon.
File name rules will still apply based on the link's name -- this
mirrors GNU's ls and dircolors behavior. The icons file (refer to the
CONFIGURATION section) should consist of whitespace-separated pairs with
a # character to start comments until the end of the line. Do not forget
to add set icons true to your lfrc to see the icons. Default values are
as follows given with their matching order in lf:
a # character to start comments until the end of the line. Each line
should contain 1-3 columns, first column is filetype or filename
pattern, second column is the icon, third column is an optional icon
color. If there is only one column, means to disable rule for this
filetype or pattern. Do not forget to add set icons true to your lfrc to
see the icons. Default values are as follows given with their matching
order in lf:

ln l
or l
Expand All @@ -2078,3 +2082,6 @@ as follows given with their matching order in lf:

A sample icons file can be found at
https://github.com/gokcehan/lf/blob/master/etc/icons.example

A sample colored icons file can be found at
https://github.com/gokcehan/lf/blob/master/etc/icons_colored.example
16 changes: 16 additions & 0 deletions etc/icons.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ sg g # SETGID
ex  # EXEC
fi  # FILE

# disable some default filetype icons, let them choose icon by filename
# ln  # LINK
# or  # ORPHAN
# tw # STICKY_OTHER_WRITABLE
# ow # OTHER_WRITABLE
# st # STICKY
# di  # DIR
# pi # FIFO
# so # SOCK
# bd # BLK
# cd # CHR
# su # SETUID
# sg # SETGID
# ex # EXEC
# fi  # FILE

# file extensions (vim-devicons)
*.styl 
*.sass 
Expand Down
Loading