2017-05-06 19:50:24 +00:00
#compdef exa
2019-02-25 17:59:30 +00:00
# Save this file as _exa in /usr/local/share/zsh/site-functions or in any
2021-08-14 22:05:22 +00:00
# other folder in $fpath. E.g. save it in a folder called ~/.zfunc and add a
2019-02-25 17:59:30 +00:00
# line containing `fpath=(~/.zfunc $fpath)` somewhere before `compinit` in your
# ~/.zshrc.
2017-05-06 19:50:24 +00:00
__exa() {
2019-02-25 17:59:30 +00:00
# Give completions using the `_arguments` utility function with
# `-s` for option stacking like `exa -ab` for `exa -a -b` and
# `-S` for delimiting options with `--` like in `exa -- -a`.
_arguments -s -S \
"(- *)"{-v,--version}"[Show version of exa]" \
"(- *)"{-'\?',--help}"[Show list of command-line options]" \
2017-05-06 19:50:24 +00:00
{-1,--oneline}"[Display one entry per line]" \
2017-05-06 22:00:45 +00:00
{-l,--long}"[Display extended file metadata as a table]" \
2017-05-06 19:50:24 +00:00
{-G,--grid}"[Display entries as a grid]" \
2017-05-06 22:00:45 +00:00
{-x,--across}"[Sort the grid across, rather than downwards]" \
2017-05-06 19:50:24 +00:00
{-R,--recurse}"[Recurse into directories]" \
{-T,--tree}"[Recurse into directories as a tree]" \
{-F,--classify}"[Display type indicator by file names]" \
2021-08-07 05:22:15 +00:00
--colo{,u}r="[When to use terminal colours]:(when):(always auto never)" \
2019-02-25 17:59:30 +00:00
--colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
2019-07-19 06:58:50 +00:00
--icons"[Display icons]" \
2020-04-08 00:08:19 +00:00
--no-icons"[Hide icons]" \
2017-05-06 19:50:24 +00:00
--group-directories-first"[Sort directories before other files]" \
2017-09-27 12:46:36 +00:00
--git-ignore"[Ignore files mentioned in '.gitignore']" \
2017-06-29 12:24:55 +00:00
{-a,--all}"[Show hidden and 'dot' files]" \
2017-05-06 19:50:24 +00:00
{-d,--list-dirs}"[List directories like regular files]" \
2019-11-14 16:21:59 +00:00
{-D,--only-dirs}"[List only directories]" \
2017-05-06 22:00:45 +00:00
{-L,--level}"+[Limit the depth of recursion]" \
2017-05-06 19:50:24 +00:00
{-r,--reverse}"[Reverse the sort order]" \
2018-12-17 04:46:50 +00:00
{-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)" \
2017-05-06 19:50:24 +00:00
{-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
2017-05-06 22:00:45 +00:00
{-b,--binary}"[List file sizes with binary prefixes]" \
{-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
2019-11-14 16:21:59 +00:00
--changed"[Use the changed timestamp field]" \
2017-05-06 22:00:45 +00:00
{-g,--group}"[List each file's group]" \
2017-05-06 19:50:24 +00:00
{-h,--header}"[Add a header row to each column]" \
2017-05-06 22:00:45 +00:00
{-H,--links}"[List each file's number of hard links]" \
{-i,--inode}"[List each file's inode number]" \
2017-05-06 19:50:24 +00:00
{-m,--modified}"[Use the modified timestamp field]" \
2021-04-03 08:47:59 +00:00
{-n,--numeric}"[List numeric user and group IDs.]" \
2017-05-06 22:00:45 +00:00
{-S,--blocks}"[List each file's number of filesystem blocks]" \
2018-12-17 04:46:50 +00:00
{-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \
2019-02-25 17:59:30 +00:00
--time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso)" \
2019-12-23 11:16:45 +00:00
--no-permissions"[Suppress the permissions field]" \
2021-03-25 06:31:56 +00:00
--octal-permissions"[List each file's permission in octal format]" \
2019-12-23 11:16:45 +00:00
--no-filesize"[Suppress the filesize field]" \
--no-user"[Suppress the user field]" \
--no-time"[Suppress the time field]" \
2017-05-06 19:50:24 +00:00
{-u,--accessed}"[Use the accessed timestamp field]" \
{-U,--created}"[Use the created timestamp field]" \
2017-05-06 22:00:45 +00:00
--git"[List each file's Git status, if tracked]" \
{-@,--extended}"[List each file's extended attributes and sizes]" \
2017-05-06 19:50:24 +00:00
'*:filename:_files'
}
__exa