Gregg's MOTD

Tips & Tricks that I've Encountered Over the Years...

Vim Tips: Searching a File for Multiple Strings

July 24, 2023 — Gregg Szumowski

In Vim you can perform a search like this: /string1/;/string2

This will will combine two searches. It tells Vim:

  1. Search for string1, then
  2. From there search for string2 on any line that also contains string1.

Tags: cli, vim, search, motd