LinuxCommandLibrary

vgrep

Interactive grep with editor integration

TLDR

Search pattern

$ vgrep "[pattern]"
copy
Search in directory
$ vgrep "[pattern]" [path]
copy
Open results interactively
$ vgrep -s "[pattern]"
copy
Show specific result
$ vgrep --show [index]
copy
No git ignore
$ vgrep --no-git "[pattern]"
copy

SYNOPSIS

vgrep [-s] [--show index] [options] pattern [path]

DESCRIPTION

vgrep is a pager for grep results that assigns an index number to each match, allowing you to quickly open specific results in your editor by number. It respects .gitignore rules by default and provides both batch and interactive modes.
In interactive mode (-s), results can be browsed and opened directly. The --show flag opens a previously indexed result without re-running the search, making it efficient for navigating through matches in a codebase.

PARAMETERS

-s

Interactive mode.
--show INDEX
Show result by index.
--no-git
Don't use gitignore.
-n
Line numbers.
-i
Case insensitive.

CAVEATS

Go implementation. Editor config needed. Different from grep.

HISTORY

vgrep was created for quickly searching code and opening results in an editor by index.

SEE ALSO

grep(1), rg(1), ag(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community