mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
Add size-prefix config knob
This commit is contained in:
parent
e3cfce0dd5
commit
8a2725a170
2 changed files with 27 additions and 0 deletions
|
|
@ -47,6 +47,21 @@ If `true` (default), always add `-g` flag to show the group ownership.
|
||||||
Default: `true`
|
Default: `true`
|
||||||
|
|
||||||
|
|
||||||
|
### `size-prefix`
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
zstyle ':omz:plugins:eza' 'size-prefix' ('binary'|'none'|'si')
|
||||||
|
```
|
||||||
|
|
||||||
|
Choose the prefix to be used in displaying file size:
|
||||||
|
|
||||||
|
* `binary` -- use [binary prefixes](https://en.wikipedia.org/wiki/Binary_prefix) such as "Ki", "Mi", "Gi" and so on
|
||||||
|
* `none` -- don't use any prefix, show size in bytes
|
||||||
|
* `si` (default) -- use [Metric/S.I. prefixes](https://en.wikipedia.org/wiki/Metric_prefix)
|
||||||
|
|
||||||
|
Default: `si`
|
||||||
|
|
||||||
|
|
||||||
### `time-style`
|
### `time-style`
|
||||||
|
|
||||||
```zsh
|
```zsh
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,18 @@ function _configure_eza() {
|
||||||
if zstyle -t ':omz:plugins:eza' 'header'; then
|
if zstyle -t ':omz:plugins:eza' 'header'; then
|
||||||
_EZA_HEAD+=("h")
|
_EZA_HEAD+=("h")
|
||||||
fi
|
fi
|
||||||
|
zstyle -s ':omz:plugins:eza' 'size-prefix' _val
|
||||||
|
case "${_val:l}" in
|
||||||
|
binary)
|
||||||
|
_EZA_HEAD+=("b")
|
||||||
|
;;
|
||||||
|
none)
|
||||||
|
_EZA_HEAD+=("B")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if zstyle -s ':omz:plugins:eza' 'header'; then
|
||||||
|
_EZA_HEAD+=("h")
|
||||||
|
fi
|
||||||
# Get the tail long-options
|
# Get the tail long-options
|
||||||
if zstyle -t ':omz:plugins:eza' 'dirs-first'; then
|
if zstyle -t ':omz:plugins:eza' 'dirs-first'; then
|
||||||
_EZA_TAIL+=("--group-directories-first")
|
_EZA_TAIL+=("--group-directories-first")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue