2

I'm using vim-grepper plugin, but I guess it doesn't really matter. What I want is when I'm searching for something inside my project via vim-grepper or some grepprg if there are matches inside opened files they would be highlighted as if I was searched for them with /some search.

  • The only real way to fix that is to have the external utility print out the location of the matches (line number, start column, end column) and then use matchaddpos() to add matches for that. For example the vim-go plugin uses this for some commands. – Martin Tournoij Aug 9 '16 at 20:20
  • It's seems to be possible to get match line and columns from Ag. I'll read about matchaddpos, thanks – user1685095 Aug 10 '16 at 4:45
  • matchaddpos() is not exactly the most user-friendly function in Vim. Ask the authors of vim-grepper to add highlighting, or switch to a plugin that already does that, f.i. CtrlSF (CtrlSF doesn't take as many sources as vim-grepper though). – Sato Katsura Aug 10 '16 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.