Skip to content

fmthoma/vgrep

Repository files navigation

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

Installation

Binaries

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

wget https://github.com/fmthoma/vgrep/releases/download/v0.1.4.1/vgrep_0.1.4.1-1_amd64.deb
sudo dpkg -i vgrep_0.1.4.1-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 https://github.com/fmthoma/vgrep.git
cd vgrep
stack setup
stack install