:substitute) is one of the first commands any Vim user learns. There are several similar commands that are more generic. Like
:s, these commands can take a range; however, unlike
:s, there is no
%variant, as these commands are global by nature.
:vglobal) (equivalent to
:g, but targets strings that do NOT match.
g/pattern/_dputs deleted lines in the null register, which has no performance cost.
y a, each yank would overwrite the previous yank.
:norm, you might notice that you can't insert linebreaks -- and
<CR>is literally printed as the strings "\r" and "".
:exec(ute)lets us actually pass in commands as strings to be executed, like
"A\r"to the pattern. Before execution, the second is evaluated to "append carriage return."