You could do it with a substitution:
:5,20s/\<i\>/j/g
5,20
: betweenBetween lines 5 and 20,s
: substitute,/\<i\>/
all instances of the word i (the\<
and\>
match word boundaries,j
with the letter j,/g
: everywhere in the line.
If you don't want to use line numbers, you could instead first select the area where you want to make the substitution in visual mode, and then Vim will pre-populate the command line with a range specifying the selection when you press :
.
If you want to make the replacement everywhere in the current buffer, you can use the %
range, instead:
:%s/\<i\>/j/g