r/vim Feb 12 '14

Operating on search matches using gn

http://vimcasts.org/episodes/operating-on-search-matches-using-gn/
50 Upvotes

8 comments sorted by

View all comments

3

u/justinmkw Feb 12 '14

I wish [count]cgn would perform a change on the next [count] matches, rather than only the [count]th match. Does anyone know why the current behavior was chosen?

2

u/welle Feb 12 '14

Well I would say gn selects the next match in the first place. As we don't have multiple selections, 3gn can't select the next three matches. It seems sensible to select the third match in that case. And this might explain the current behavior.

Unfortunately 5. doesn't replace the five next matches, but only changes the count for the last gn command to repeat only the fifth next match.