Find first non-matching line in VIM

I believe if you simply want to have your cursor end up at the first non-matching line you can use visual as the command in your global command. So:

:v/pattern/visual

will leave your cursor at the first non-matching line. Or:

:g/pattern/visual

will leave your cursor at the first matching line.

Leave a Comment