I want to select multiple lines in vim, copy them, and paste after that chunk of code (with cursor at the beginning).
yp
doesn't work because in visual chunk of code,
vim pastes after the 1st line of visually selected lines inside that visual block,
not after the whole visually selected chunk of code.
Is there any better way to do this?
I tried to make an alternative solution on my own but didn't succeed.
After some workaround, here's my config
vmap <silent> <c-l> yP
When I press Ctrl+l
[cursor-position]for(int i=0; i<5; i++){
cout << n[i] << " ";
}
I get this
[cursor-position]for(int i=0; i<5; i++){
cout << n[i] << " ";
}
for(int i=0; i<5; i++){
cout << n[i] << " ";
}
but I want
for(int i=0; i<5; i++){
cout << n[i] << " ";
}
[cursor-position]for(int i=0; i<5; i++){
cout << n[i] << " ";
}