Insert line above matched line
When used in a substitution command, &
is replaced by the text that matches the search pattern. If we match a pattern from the beginning of a line, we can insert something above it by replacing the match with the new content, a line break and the matched pattern.
Source: :h &
Last updated