MyNixOS website logo
Description

A pager for grep.

vgrep is a pager for navigating through grep output.

Usage:

grep -rn foo | vgrep
vgrep foo /some/path
vgrep foo /some/path | vgrep bar

Use hjkl or arrow keys to navigate, Enter to view file, q to quit.

vgrep -- A pager for grep

Screenshot

Usage

  • As a pager:

    grep -rn data /some/path | vgrep  # -n for line numbers
    
  • As a drop-in replacement for grep:

    vgrep data /some/path                  # recursive by default
    vgrep data /some/path | vgrep default  # works with pipes, too
    
  • With a git alias defined in your ~/.gitconfig:

    git config --global alias.vgrep '!__git_vgrep () { git grep --color=always "$@" | vgrep; }; __git_vgrep'
    git vgrep data
    
  • Using ack/ag instead of grep? No problem:

    ack data | vgrep           # Output of `ack` is compatible
    ack --color data | vgrep   # Even coloring works
    ag --color data | vgrep    # Same for `ag`
    

Keybindings:

  • Use hjkl or the arrow keys to navigate
  • Enter opens a pager with the selected file
  • e opens the selected file in $EDITOR
  • Tab switches between results list and pager
  • q closes the pager and then the entire application.

Installation

Via nix from nixpkgs

nix-env -iA nixpkgs.haskellPackages.vgrep

From Hackage

Installation from Hackage via stack is recommended:

stack update
stack install vgrep

This will install vgrep to your ~/.local/bin directory.

From source

git clone https://github.com/fmthoma/vgrep.git
cd vgrep
stack setup
stack install
Metadata

Version

0.2.3.0

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows