#compdef rg

_arguments \
    '*:file:_files' \
    {-e,--regexp}'' \
    '-f[This flag can also be used when searching for patterns that start with a dash]' \
    {-f,--file}'' \
    '--pre' \
    '--no-pre[WARNING When this flag is set, ripgrep will unconditionally spawn a process f…]' \
    '--pre-glob' \
    {-z,--search-zip}'' \
    {-s,--case-sensitive}'' \
    '--crlf' \
    '--dfa-size-limit' \
    {-E,--encoding}'' \
    '--engine' \
    '-e' \
    {-F,--fixed-strings}'' \
    {-i,--ignore-case}'' \
    {-v,--invert-match}'' \
    '--files-without-match[matching lines]' \
    {-x,--line-regexp}'' \
    {-m,--max-count}'' \
    '--mmap' \
    {-U,--multiline}'' \
    '--multiline-dotall[default. This flag only applies when multiline search is enabled]' \
    '-U' \
    '--no-unicode' \
    '--null-data' \
    {-P,--pcre2}'' \
    '--regex-size-limit' \
    {-S,--smart-case}'' \
    '--stop-on-nonmatch' \
    {-a,--text}'' \
    {-j,--threads}'' \
    {-w,--word-regexp}'' \
    '--auto-hybrid-regex' \
    '--no-pcre2-unicode' \
    '--binary' \
    {-L,--follow}'' \
    '--no-messages' \
    {-g,--glob}'' \
    '--glob-case-insensitive' \
    '--hidden' \
    '--iglob' \
    '--ignore-file' \
    '--ignore-file-case-insensitive' \
    {-d,--max-depth}'' \
    '--max-filesize' \
    '--no-ignore' \
    {--no-ignore-exclude,--no-ignore-global,--no-ignore-parent}'' \
    '--no-ignore-vcs' \
    '-u' \
    '--no-ignore-dot' \
    '--no-ignore-files' \
    '--no-require-git' \
    '--one-file-system' \
    {-t,--type}'' \
    '-t' \
    {-T,--type-not}'' \
    '--type-add' \
    '--type-clear[of ripgrep]' \
    {-u,--unrestricted}'' \
    {-A,--after-context}'' \
    '-C' \
    {-B,--before-context}'' \
    '--block-buffered' \
    {-b,--byte-offset}'' \
    '--color' \
    {--vimgrep,--json}'[The possible values for this flag are:]' \
    '--colors' \
    '--column' \
    {-C,--context}'' \
    '-B[the order. For example, -A2 -C1 is equivalent to -A2 -B1]' \
    '--context-separator' \
    '--no-context-separator' \
    '--field-context-separator' \
    '--field-match-separator' \
    '--heading' \
    {-h,--help}'' \
    '--hostname-bin' \
    '--hyperlink-format' \
    '-H' \
    '--include-zero' \
    '--line-buffered' \
    {-n,--line-number}'' \
    {-N,--no-line-number}'' \
    {-M,--max-columns}'' \
    '--max-columns-preview' \
    {-0,--null}'' \
    {-o,--only-matching}'' \
    '--path-separator' \
    '--passthru' \
    {-p,--pretty}'' \
    {-q,--quiet}'' \
    {-r,--replace}'' \
    '--sort' \
    '--sortr' \
    '--trim' \
    {-H,--with-filename}'' \
    {-I,--no-filename}'' \
    '--sort-files' \
    {-c,--count}'' \
    '--count-matches' \
    {-l,--files-with-matches}'' \
    {-l,-c}'' \
    {-o,-r,-M}'[have no effect when --json is set]' \
    '--debug' \
    '--no-ignore-messages' \
    '--stats' \
    '--trace' \
    '--files' \
    '--generate' \
    '--no-config' \
    '--pcre2-version' \
    '--type-list' \
    {-V,--version}'' \
    '-L' \
    '-uu' \
    '-uuu' \
    '-a[line terminators, which typically prevents exorbitant memory usage]'
