The find and replace command has a range option. In this case you are performing this action against the entire document %
. You can also select a more specific range. So lets say you want to swap lines 51 through 57
:51,57s/foo/bar/gc
If you want to go to end of the document use $
:51,$s/foo/bar/gc
Per :h range
Line numbers may be specified with: :range E14 {address}
{number} an absolute line number
. the current line :.
$ the last line in the file :$
% equal to 1,$ (the entire file) :%
't position of mark t (lowercase) :'
'T position of mark T (uppercase); when the mark is in
another file it cannot be used in a range
/{pattern}[/] the next line where {pattern} matches :/
?{pattern}[?] the previous line where {pattern} matches :?
\/ the next line where the previously used search
pattern matches
\? the previous line where the previously used search
pattern matches
\& the next line where the previously used substitute
pattern matches