I want to duplicate a line with Vim. Every time when I use yyp or any other command, I have to jump the cursor to the position where it was. Is there any trick to duplicate a line and jump the cursor to its position, like maybe using a macro to save current the cursor position, duplicate, and then jump to the required position?
The only solution I'd see to do what you want, given you only use it for yyp (i.e. copy currentline and paste it below), is to record in a macro:
mmyyp`mj
what that does is:
m, mideally what you'd want is a jump to a column, not changing the row. I'm not sure if it's possible, I never needed that before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With