I came across a vim plugin called EasyGrep and so far it has been great however i wanted to know if it was possible to search only the buffer you are in and if possible specify the path you would like to grep ?


1 Answer 1


You can use the % for defining the path you are searching through:

:grep pattern %

In a more generic way, after the pattern, you can specify the path you want to search in:

:grep pattern **/*.c

Depending on the grep program you use, you may need to adjust this but it.

See: :h grep

  • In easy grep isnt the g in grep supposed to be in capital ? Jul 25, 2016 at 8:51
  • Oh, I thought your question was about the build-in grep functionality. My bad.
    – nobe4
    Jul 25, 2016 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.