_exa 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #compdef exa
  2. # Save this file as _exa 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. __exa() {
  7. # Give completions using the `_arguments` utility function with
  8. # `-s` for option stacking like `exa -ab` for `exa -a -b` and
  9. # `-S` for delimiting options with `--` like in `exa -- -a`.
  10. _arguments -s -S \
  11. "(- *)"{-v,--version}"[Show version of exa]" \
  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. {-F,--classify}"[Display type indicator by file names]" \
  20. --colo{,u}r="[When to use terminal colours]:(when):(always auto never)" \
  21. --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
  22. --icons"[Display icons]" \
  23. --no-icons"[Hide icons]" \
  24. --group-directories-first"[Sort directories before other files]" \
  25. --git-ignore"[Ignore files mentioned in '.gitignore']" \
  26. {-a,--all}"[Show hidden and 'dot' files]" \
  27. {-d,--list-dirs}"[List directories like regular files]" \
  28. {-D,--only-dirs}"[List only directories]" \
  29. {-L,--level}"+[Limit the depth of recursion]" \
  30. {-r,--reverse}"[Reverse the sort order]" \
  31. {-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)" \
  32. {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
  33. {-b,--binary}"[List file sizes with binary prefixes]" \
  34. {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
  35. --changed"[Use the changed timestamp field]" \
  36. {-g,--group}"[List each file's group]" \
  37. {-h,--header}"[Add a header row to each column]" \
  38. {-H,--links}"[List each file's number of hard links]" \
  39. {-i,--inode}"[List each file's inode number]" \
  40. {-m,--modified}"[Use the modified timestamp field]" \
  41. {-n,--numeric}"[List numeric user and group IDs.]" \
  42. {-S,--blocks}"[List each file's number of filesystem blocks]" \
  43. {-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \
  44. --time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso relative)" \
  45. --no-permissions"[Suppress the permissions field]" \
  46. --octal-permissions"[List each file's permission in octal format]" \
  47. --no-filesize"[Suppress the filesize field]" \
  48. --no-user"[Suppress the user field]" \
  49. --no-time"[Suppress the time field]" \
  50. {-u,--accessed}"[Use the accessed timestamp field]" \
  51. {-U,--created}"[Use the created timestamp field]" \
  52. --git"[List each file's Git status, if tracked]" \
  53. {-@,--extended}"[List each file's extended attributes and sizes]" \
  54. '*:filename:_files'
  55. }
  56. __exa