LinuxCommandLibrary

igrep

Interactive grep with TUI for browsing results

TLDR

Search for a pattern in the current directory
$ igrep "[pattern]"
copy
Search in a specific directory
$ igrep "[pattern]" [path/to/directory]
copy
Search case-insensitively
$ igrep -i "[pattern]"
copy
Search hidden files
$ igrep --hidden "[pattern]"
copy
Filter by file type
$ igrep -t [rust] "[pattern]"
copy
Open results in a specific editor
$ igrep --editor [nvim] "[pattern]"
copy

SYNOPSIS

igrep [-i] [--hidden] [-t type] [--editor editor] pattern [path]

DESCRIPTION

igrep (Interactive Grep) runs ripgrep in the background and provides a TUI to interactively browse search results. When you select a match, it opens the file at the matching line in your text editor of choice (Vim by default). Supported editors include Vim, Neovim, nano, VS Code, Emacs, Helix, Sublime Text, Micro, and various JetBrains IDEs.
The interface allows filtering, sorting, and navigating through results with keyboard shortcuts, making it efficient for exploring large codebases.

CAVEATS

Requires ripgrep (rg) as a dependency for the search backend. Editor integration depends on the editor supporting line-number arguments.

HISTORY

igrep was created by konradsz and is written in Rust. It was designed to bridge the gap between grep's search capabilities and editor integration, providing a visual selection layer.

SEE ALSO

grep(1), rg(1), fzf(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard