If I want to find occurrences of the word 'arc', I can type / arc
, with spaces around the three letters, to find basic occurrences of the word (ignoring punctuation). But suppose I want to find where two words are close together, say, within ten words? Here's an example:
Now is the time for all good men to come to the aid of their country.
In this test, I want to find all occurrences where the word 'aid' is within ten words of the word 'country'. How can I do that in Vim?
/\<arc\>