completions.zsh 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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]" \
  21. --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
  22. --group-directories-first"[Sort directories before other files]" \
  23. --git-ignore"[Ignore files mentioned in '.gitignore']" \
  24. {-a,--all}"[Show hidden and 'dot' files]" \
  25. {-d,--list-dirs}"[List directories like regular files]" \
  26. {-L,--level}"+[Limit the depth of recursion]" \
  27. {-r,--reverse}"[Reverse the sort order]" \
  28. {-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)" \
  29. {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
  30. {-b,--binary}"[List file sizes with binary prefixes]" \
  31. {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
  32. {-g,--group}"[List each file's group]" \
  33. {-h,--header}"[Add a header row to each column]" \
  34. {-H,--links}"[List each file's number of hard links]" \
  35. {-i,--inode}"[List each file's inode number]" \
  36. {-m,--modified}"[Use the modified timestamp field]" \
  37. {-S,--blocks}"[List each file's number of filesystem blocks]" \
  38. {-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \
  39. --time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso)" \
  40. {-u,--accessed}"[Use the accessed timestamp field]" \
  41. {-U,--created}"[Use the created timestamp field]" \
  42. --git"[List each file's Git status, if tracked]" \
  43. {-@,--extended}"[List each file's extended attributes and sizes]" \
  44. '*:filename:_files'
  45. }
  46. __exa