Operating on search matches using gn

Published: Feb. 11, 2014, midnight

The gn command (introduced in Vim 7.4) makes it easy to operate on regions of text that match the current search pattern. It’s especially useful when used with a regex that matches text regions of variable length.