fork/eza

git clone https://git.julia.blue/fork/eza

Christina SørensenMerge pull request #533 from Xemptuous/feature/add-recursive-dir-sizea41a8208

v0.15.1
4.3 KiB72 linesraw
1#compdef eza
2
3# Save this file as _eza in /usr/local/share/zsh/site-functions or in any
4# other folder in $fpath.  E.g. save it in a folder called ~/.zfunc and add a
5# line containing `fpath=(~/.zfunc $fpath)` somewhere before `compinit` in your
6# ~/.zshrc.
7
8__eza() {
9    # Give completions using the `_arguments` utility function with
10    # `-s` for option stacking like `eza -ab` for `eza -a -b` and
11    # `-S` for delimiting options with `--` like in `eza -- -a`.
12    _arguments -s -S \
13        "(- *)"{-v,--version}"[Show version of eza]" \
14        "(- *)"--help"[Show list of command-line options]" \
15        {-1,--oneline}"[Display one entry per line]" \
16        {-l,--long}"[Display extended file metadata as a table]" \
17        {-G,--grid}"[Display entries as a grid]" \
18        {-x,--across}"[Sort the grid across, rather than downwards]" \
19        {-R,--recurse}"[Recurse into directories]" \
20        {-T,--tree}"[Recurse into directories as a tree]" \
21        {-X,--dereference}"[Dereference symbolic links when displaying information]" \
22        {-F,--classify}"[Display type indicator by file names]" \
23        --colo{,u}r="[When to use terminal colours]:(when):(always auto automatic never)" \
24        --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
25        --icons="[When to display icons]:(when):(always auto automatic never)" \
26        --no-quotes"[Don't quote filenames with spaces]" \
27        --hyperlink"[Display entries as hyperlinks]" \
28        --group-directories-first"[Sort directories before other files]" \
29        --git-ignore"[Ignore files mentioned in '.gitignore']" \
30        {-a,--all}"[Show hidden and 'dot' files. Use this twice to also show the '.' and '..' directories]" \
31        {-A,--almost-all}"[Equivalent to --all; included for compatibility with `ls -A`]" \
32        {-d,--list-dirs}"[List directories like regular files]" \
33        {-D,--only-dirs}"[List only directories]" \
34        {-f,--only-files}"[List only files]" \
35        {-L,--level}"+[Limit the depth of recursion]" \
36        {-w,--width}"+[Limits column output of grid, 0 implies auto-width]" \
37        {-r,--reverse}"[Reverse the sort order]" \
38        {-s,--sort}="[Which field to sort by]:(sort field):(accessed age changed created date extension Extension filename Filename inode modified oldest name Name newest none size time type)" \
39        {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
40        {-b,--binary}"[List file sizes with binary prefixes]" \
41        {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
42        --changed"[Use the changed timestamp field]" \
43        {-g,--group}"[List each file's group]" \
44        {-h,--header}"[Add a header row to each column]" \
45        {-H,--links}"[List each file's number of hard links]" \
46        {-i,--inode}"[List each file's inode number]" \
47        {-m,--modified}"[Use the modified timestamp field]" \
48        {-n,--numeric}"[List numeric user and group IDs.]" \
49        {-S,--blocksize}"[List each file's size of allocated file system blocks.]" \
50        {-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \
51        --time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso relative)" \
52        --total-size="[Show recursive directory size]" \
53        --no-permissions"[Suppress the permissions field]" \
54        {-o,--octal-permissions}"[List each file's permission in octal format]" \
55        --no-filesize"[Suppress the filesize field]" \
56        --no-user"[Suppress the user field]" \
57        --no-time"[Suppress the time field]" \
58        {-u,--accessed}"[Use the accessed timestamp field]" \
59        {-U,--created}"[Use the created timestamp field]" \
60        {-X,--dereference}"[dereference symlinks for file information]" \
61        --git"[List each file's Git status, if tracked]" \
62        --no-git"[Suppress Git status]" \
63        --git-repos"[List each git-repos status and branch name]" \
64        --git-repos-no-status"[List each git-repos branch name (much faster)]" \
65        {-@,--extended}"[List each file's extended attributes and sizes]" \
66        {-Z,--context}"[List each file's security context]" \
67        {-M,--mounts}"[Show mount details (long mode only)]" \
68        '*:filename:_files' \
69        --smart-group"[Only show group if it has a different name from owner]"
70}
71
72__eza