show number of matching pattern like
102 matches on 102 lines.
How to copy this output to a register?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
:redir @a | %s///n | redir END
An alternative is
%s///n is the last command, you can type:
or if you want to paste it immediately into the document, switch to insert mode and type
:R %s///n @a