In Vim, let's say I want to replace the contents of one String with the content of another.
Original input
var1 = "January"
var2 = "February"
Desired output
var1 = "January"
var2 = "January"
What I would usually do is:
- Move cursor to line 1
y
i
"
(yank inner quotes)
- Move cursor to the destination quote in line 2
v
i
"
p
(visual select inner quotes, paste)
While this works well, I generally try to avoid visual mode when possible, so I am not completely satisfied with my step 4 (v
i
"
p
).
Is there any way to specify a "destination paste area" without using Visual mode? I suspect it might be something chained to g
, but I can't think of anything.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…