Let's say I want to highlight/search all the lines in a file opened with vim with following criteria.

Criteria: Lines which start with "start123" and end with "321end". There could be anything between these two patterns.

I tried following but no luck.


Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.


Just match anything (.*) between the start and end patterns:

  • Perfect. I was close it means.. – Milind Dumbare Mar 24 '15 at 19:11

Your Answer

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

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