_eza 4.9 KB

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