fork/eza

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

Christina SørensenMerge pull request #438 from hehelego/main6e9d53f3

v0.14.1
4.0 KiB69 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        {-F,--classify}"[Display type indicator by file names]" \
22        --colo{,u}r="[When to use terminal colours]:(when):(always auto automatic never)" \
23        --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
24        --icons"[Display icons]" \
25        --no-icons"[Hide icons]" \
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        {-d,--list-dirs}"[List directories like regular files]" \
32        {-D,--only-dirs}"[List only directories]" \
33        {-f,--only-files}"[List only files]" \
34        {-L,--level}"+[Limit the depth of recursion]" \
35        {-w,--width}"+[Limits column output of grid, 0 implies auto-width]" \
36        {-r,--reverse}"[Reverse the sort order]" \
37        {-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)" \
38        {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
39        {-b,--binary}"[List file sizes with binary prefixes]" \
40        {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
41        --changed"[Use the changed timestamp field]" \
42        {-g,--group}"[List each file's group]" \
43        {-h,--header}"[Add a header row to each column]" \
44        {-H,--links}"[List each file's number of hard links]" \
45        {-i,--inode}"[List each file's inode number]" \
46        {-m,--modified}"[Use the modified timestamp field]" \
47        {-n,--numeric}"[List numeric user and group IDs.]" \
48        {-S,--blocksize}"[List each file's size of allocated file system blocks.]" \
49        {-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \
50        --time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso relative)" \
51        --no-permissions"[Suppress the permissions field]" \
52        {-o,--octal-permissions}"[List each file's permission in octal format]" \
53        --no-filesize"[Suppress the filesize field]" \
54        --no-user"[Suppress the user field]" \
55        --no-time"[Suppress the time field]" \
56        {-u,--accessed}"[Use the accessed timestamp field]" \
57        {-U,--created}"[Use the created timestamp field]" \
58        {-X,--dereference}"[dereference symlinks for file information]" \
59        --git"[List each file's Git status, if tracked]" \
60        --no-git"[Suppress Git status]" \
61        --git-repos"[List each git-repos status and branch name]" \
62        --git-repos-no-status"[List each git-repos branch name (much faster)]" \
63        {-@,--extended}"[List each file's extended attributes and sizes]" \
64        {-Z,--context}"[List each file's security context]" \
65        {-M,--mounts}"[Show mount details (long mode only)]" \
66        '*:filename:_files'
67}
68
69__eza