idx search for filesystem
Search indexed file contents.
Signature
> idx search {flags} ...rest
Flags
--regex, -r: Use regular-expression matching mode.--fuzzy, -f: Use fuzzy line-matching mode.--limit, -l {int}: Maximum number of matches to collect.--context, -c {oneof<range, int>}: The number of context lines to include before and after each match can be specified as an integer or a range. An integer sets both the before and after context to that number, while a range uses a negative value for lines before and a positive value for lines after (e.g., -3..5).
Parameters
...rest: One or more search patterns.
Input/output types:
| input | output |
|---|---|
| nothing | list<record> |
Examples
Search indexed file contents for a plain text pattern.
> idx search helloSearch using a regular expression.
> idx search --regex 'fn \w+'Search with multiple patterns simultaneously.
> idx search TODO FIXME HACKInclude 2 lines of context before and 5 lines after each match.
> idx search error -2..5Brackets and question marks are treated as literal text, not glob patterns.
> idx search 'arr[0]'Glob patterns with a path separator filter which files to search.
> idx search pattern tests/*Brace expansion globs also filter which files to search.
> idx search pattern *.{rs,js}Notes
Mode selection: plain text is the default and treats each pattern literally, --regex evaluates the patterns as regular expressions, and --fuzzy performs approximate line matching.