10 releases (3 stable)

1.2.0 Aug 8, 2023
1.1.0 Jan 29, 2023
0.5.1 Aug 1, 2022
0.5.0 Apr 24, 2022
0.1.2 Feb 19, 2022

#13 in #grep

Download history 50/week @ 2023-08-05 26/week @ 2023-08-12 32/week @ 2023-08-19 19/week @ 2023-08-26 18/week @ 2023-09-02 21/week @ 2023-09-09 8/week @ 2023-09-16 8/week @ 2023-09-23 10/week @ 2023-09-30 7/week @ 2023-10-07 4/week @ 2023-10-14 15/week @ 2023-10-21 17/week @ 2023-10-28 6/week @ 2023-11-04 17/week @ 2023-11-11 9/week @ 2023-11-18

55 downloads per month

MIT license

2.5K SLoC

igrep - Interactive Grep

Runs grep (ripgrep's library) in the background, allows interactively pick its results and open selected match in text editor of choice (vim by default).

igrep supports macOS and Linux. Reportedly it works on Windows as well.


ig [OPTIONS] <PATTERN|--type-list> [PATHS]...


<PATTERN>    Regular expression used for searching.
<PATHS>...   Files or directories to search. Directories are searched recursively.
             If not specified, searching starts from current directory.


-., --hidden                  Search hidden files and directories. By default, hidden files and
                              directories are skipped.
--editor <EDITOR>             Text editor used to open selected match.
                              [possible values: check supported text editors section]
-g, --glob <GLOB>             Include files and directories for searching that match the given glob.
                              Multiple globs may be provided.
-h, --help                    Print help information
-i, --ignore-case             Searches case insensitively.
-S, --smart-case              Searches case insensitively if the pattern is all lowercase.
                              Search case sensitively otherwise.
-t, --type <TYPE_MATCHING>    Only search files matching TYPE.
                              Multiple types may be provided.
-T, --type-not <TYPE_NOT>     Do not search files matching TYPE-NOT.
                              Multiple types-not may be provided.
    --theme <THEME>           UI color theme [default: dark] [possible values: light, dark]
    --type-list               Show all supported file types and their corresponding globs.
-V, --version                 Print version information.

NOTE: ig respects ripgrep's configuration file if RIPGREP_CONFIG_PATH environment variable is set and reads all supported options from it.


Key Action
q, Esc, Ctrl+c Quit
Down, j Select next match
Up,k Select previous match
Right, l, PageDown Select match in next file
Left, h, PageUp Select match in previous file
gg, Home Jump to the first match
Shift-g, End Jump to the last match
Enter Open current file
dd, Delete Filter out selected match
dw Filter out all matches in current file
v Toggle vertical context viewer
s Toggle horizontal context viewer
F5 Open search pattern popup

Supported text editors

igrep supports Vim, Neovim, nano, VS Code (stable and insiders), Emacs, EmacsClient, Helix, SublimeText, Micro, Intellij, Goland and Pycharm. If your beloved editor is missing on this list and you still want to use igrep please file an issue.

Specifying text editor

To specify the editor, use one of the following (listed in order of their precedence):

  • --editor option,
  • $IGREP_EDITOR variable,
  • $VISUAL variable,
  • $EDITOR variable.

Higher priority option overrides lower one. If neither of these options is set, vim is used as a default.


Prebuilt binaries

igrep binaries can be downloaded from GitHub.


brew tap konradsz/igrep https://github.com/konradsz/igrep.git
brew install igrep


scoop bucket add igrep https://github.com/konradsz/igrep.git
scoop install igrep

Arch Linux

pacman -S igrep

Build from source

Build and install from source using Rust toolchain by running: cargo install igrep.


~394K SLoC