Reputation: 3597
I am using gvim as my text editor on linux server. I have a large file, some 10K lines.
I need to select n
number of lines; e.g., lines 512
to 1034
and replace them with another lines. How can I achieve this?
Upvotes: 1
Views: 2944
Reputation: 3597
Select a particular line and use the nj
command where n
is the number of lines u want to jump.
Upvotes: 1
Reputation: 31419
If the other lines are in a file you could do the following.
:512,1034d | r <filename>
512,1034
specifies a range from line 512 to 1034.
d
deletes the line
After the lines are removed you place the content of <filename>
at line 512 with r
or read
If the contents are in the "
register (as if you yanked the contents) you could use
:512,1034p
to replace those lines with the contents of the "
register.
Upvotes: 7