2022-08-21 04:04:38 +05:30
|
|
|
# vgrep
|
|
|
|
|
|
|
|
> A user friendly pager for grep.
|
|
|
|
> See also: `ugrep`, `rg`.
|
2025-05-11 20:03:52 +03:00
|
|
|
> More information: <https://github.com/vrothberg/vgrep/blob/main/docs/vgrep.1.md>.
|
2022-08-21 04:04:38 +05:30
|
|
|
|
|
|
|
- Recursively search the current directory for a pattern and cache it:
|
|
|
|
|
|
|
|
`vgrep {{search_pattern}}`
|
|
|
|
|
|
|
|
- Display the contents of the cache:
|
|
|
|
|
|
|
|
`vgrep`
|
|
|
|
|
|
|
|
- Open the "4th" match from the cache in the default editor:
|
|
|
|
|
2025-05-11 20:03:52 +03:00
|
|
|
`vgrep {{[-s|--show]}} {{4}}`
|
2022-08-21 04:04:38 +05:30
|
|
|
|
|
|
|
- Display a context of "3" lines for each match in the cache:
|
|
|
|
|
2025-05-11 20:03:52 +03:00
|
|
|
`vgrep {{[-s|--show]}} {{[c|context]}}{{3}}`
|
2022-08-21 04:04:38 +05:30
|
|
|
|
|
|
|
- Display the number of matches for each directory in the tree:
|
|
|
|
|
2025-05-11 20:03:52 +03:00
|
|
|
`vgrep {{[-s|--show]}} {{[t|tree]}}`
|
2022-08-21 04:04:38 +05:30
|
|
|
|
|
|
|
- Display the number of matches for each file in the tree:
|
|
|
|
|
2025-05-11 20:03:52 +03:00
|
|
|
`vgrep {{[-s|--show]}} {{[f|files]}}`
|
2022-08-21 04:04:38 +05:30
|
|
|
|
|
|
|
- Start an interactive shell with cached matches:
|
|
|
|
|
2025-05-11 20:03:52 +03:00
|
|
|
`vgrep {{[-i|--interactive]}}`
|