I am trying to use a for loop iterator variable in a vim search pattern to determine for a range of words how man times they occur in a file. What I do so far is:
for i in range(1,40) | %s/SiTg//gn | endfor
I need the iterator variable i
in the search pattern %s/S\iTg//gn
to be bound by the for loop. How can I achieve this in vim?