- #1
- 6,375
- 980
I have a recurrent vim problem:
Often, I want to replace part of a file (call it B) with text from some other file (A).
So in A I select the lines in question and yank them.
Now in B i use the visual command to select the region I want to replace.
I am not happy with it for two reasons:
1. I would prefer to specify the region explicitly, something like: 1,20v
however this seems not to be possible with the visual command.
2. the visual command replaces the text in the yank buffer with the text deleted upon paste.
If I want to repeat the operation in another file C, I have to yank the text in file A again.
There must be some more elegant way, however I didn't find it.
Often, I want to replace part of a file (call it B) with text from some other file (A).
So in A I select the lines in question and yank them.
Now in B i use the visual command to select the region I want to replace.
I am not happy with it for two reasons:
1. I would prefer to specify the region explicitly, something like: 1,20v
however this seems not to be possible with the visual command.
2. the visual command replaces the text in the yank buffer with the text deleted upon paste.
If I want to repeat the operation in another file C, I have to yank the text in file A again.
There must be some more elegant way, however I didn't find it.