04cba220f7bd7b27483a5b346e2ca717f0341895

Author
Nico Just <nicojust@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(eza): add color-scale options (#12841)

Diff

 1diff --git a/plugins/eza/README.md b/plugins/eza/README.md
 2index 90e5499942cde9a1ef3f1ab801b0e548066b601e..bec1f85cb9382569ab0ed86c4cdf8c9f94b33f12 100644
 3--- a/plugins/eza/README.md
 4+++ b/plugins/eza/README.md
 5@@ -65,6 +65,29 @@ If `yes`, sets the `--icons` option of `eza`, adding icons for files and folders
 6 
 7 Default: `no`
 8 
 9+### `color-scale`
10+
11+```zsh
12+zstyle ':omz:plugins:eza' 'color-scale' all|age|size
13+```
14+
15+Highlight levels of field(s) distinctly. Use comma(,) separated list of `all`, `age`, `size`
16+
17+Default: `none`
18+
19+### `color-scale-mode`
20+
21+```zsh
22+zstyle ':omz:plugins:eza' 'color-scale-mode' gradient|fixed
23+```
24+
25+Choose the mode for highlighting:
26+
27+- `gradient` (default) -- gradient coloring
28+- `fixed` -- fixed coloring
29+
30+Default: `gradient`
31+
32 ### `size-prefix`
33 
34 ```zsh
35diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh
36index f25f1c30ba74612fb57449f8260ac57b1b59fb97..60ed1eb2777b27dc1155971f37d232b3b1f7adde 100644
37--- a/plugins/eza/eza.plugin.zsh
38+++ b/plugins/eza/eza.plugin.zsh
39@@ -34,6 +34,14 @@ function _configure_eza() {
40   if zstyle -t ':omz:plugins:eza' 'icons'; then
41     _EZA_TAIL+=("--icons=auto")
42   fi
43+  zstyle -s ':omz:plugins:eza' 'color-scale' _val
44+  if [[ $_val ]]; then
45+    _EZA_TAIL+=("--color-scale=$_val")
46+  fi
47+  zstyle -s ':omz:plugins:eza' 'color-scale-mode' _val
48+  if [[ $_val == (gradient|fixed) ]]; then
49+    _EZA_TAIL+=("--color-scale-mode=$_val")
50+  fi
51   zstyle -s ':omz:plugins:eza' 'time-style' _val
52   if [[ $_val ]]; then
53     _EZA_TAIL+=("--time-style='$_val'")