A pager for grep

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Franz Thoma

vgrep – A pager for grep



  • 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`


  • 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.



Debian/Ubuntu: .deb files are available for the latest release.

sudo dpkg -i vgrep_0.2.0.0-1_amd64.deb

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
cd vgrep
stack setup
stack install




  • Add support for aeson 1.2.x to enable build with Stackage LTS 10.x


  • Add support for aeson 1.x to enable build with Stackage LTS 9.x
  • Add less-like keybindings Ctrl-u, Ctrl-d (half-page-up/down, only in pager) and Ctrl-b, Ctrl-f (full-page-up/down).


  • Added support for a config file: A YAML file located at ~/.vgrep/config.yaml is recognized as configuration file for colors, keybindings and other settings. The default config file can be produced using vgrep --dump-default-config > ~/.vgrep/config.yaml.
  • Added support for colorized input (ANSI CSI/SGR escape codes). vgrep can now be used together wit grep --color=always (and git grep --color=always), which is now enabled by default when using vgrep as drop-in replacement for grep.


  • Switch to strict Text
  • Less dependent on template-haskell


  • User events (like key events) now have priority over other events, the UI does not block any more.
  • --help and --version now produce sensible output.


  • Fix pageUp in Results view


  • Performance improvements
  • Tests for Pager and Results widget
  • Haddock documentation


  • Fixed j/k keys in pager view
  • Additional h/l// keybindings for horizontal scrolling in pager
  • Matching lines are now highlighted in pager view


comments powered byDisqus