Skip to content
Marco Hinz edited this page Aug 1, 2015 · 22 revisions

How to win at grep - with vim-grepper

Installation

Use your favourite Vim plugin manager to install vim-grepper:

vimrc:

call plug#begin('~/.vim/bundle')
  Plug 'mhinz/vim-grepper'
call plug#end()

Afterwards reload your vimrc with :so %, then kick off the actual installation with :PlugInstall.

Configuration

Now we need to set up the mappings for vim-grepper, as it doesn't come with any predefined mappings. "Why?", you ask? Because there's no right mapping. Use whatever you like. Personally I like these:

nmap <leader>g <plug>(Grepper)
xmap <leader>g <plug>(Grepper)
cmap <leader>g <plug>(GrepperNext)
nmap gs        <plug>(GrepperMotion)
xmap gs        <plug>(GrepperMotion)

If you don't understand these mappings, no worries, I'll guide you through it. This is all the configuration you need for starters. Restart Vim for getting vim-grepper recognized as a new plugin.

Clone this wiki locally