Vim Search and Replace Efficiency

Viewed 205

Often I want to search and replace in vim like this:

:%s/<search_pattern>/<search_pattern>_foo/g

Is there a way to make this syntax more efficient so that I can reference <search_pattern> in the replace value? I'm thinking it would be something similar to back referencing by group name/number, but I can't find any docs on this.

2 Answers
Related