The real bottleneck, here seems to be all the jjjj…
that you are doing. The supposed superiority of hjkl
over the arrow keys is cited so often that people tend to forget the immense value of Vim's motions and text-objects over both tedious methods.
Supposing you are on the first line of a paragraph as defined by Vim (text between blank lines), y'}P
should yank the whole paragraph including the blank line that follows and paste it above the current line.
some text above
[l]orem ipsum dolor sit amet
ipsum lorem dolor sit amet
lorem dolor ipsum sit amet
lorem ipsum sit dolor amet
lorem ipsum dolor amet sit
some text below
y'}P
some text above
[l]orem ipsum dolor sit amet
ipsum lorem dolor sit amet
lorem dolor ipsum sit amet
lorem ipsum sit dolor amet
lorem ipsum dolor amet sit
lorem ipsum dolor sit amet
ipsum lorem dolor sit amet
lorem dolor ipsum sit amet
lorem ipsum sit dolor amet
lorem ipsum dolor amet sit
some text below
v}yP
should work too, in a more comfortable way.
If your block is not a "paragraph", there's probably a way to define the selection with a motion instead of jjj
. Something like V/it$<cr>
.
edit
Here is another variant that places the copy below the original: y'}'}p
.
edit
I think that the most generic way to shorten the whole process is to extend the visual selection either:
Once the selection is done, you can:
yank (y
),
move to the end of the visual selection ('>
or 5j
but '>
is more generic),
open a new line (o
),
leave insert mode (<Esc>
),
paste (p
)
This method is probably the most generic but that's still a lot of typing. That's where mappings come to the rescue:
vnoremap <F9> y'>o<Esc>p
The idea, here, is to separate the contextual from the generic:
the contextual part is when you define the block to duplicate, because there's no way to predict what you want to duplicate I leave this part to your discretion but I hope you'll use a better method than jjjjjj…
the generic part is everything that follows the selection, done here with a simple mapping.
The whole process is now reduced to V5j<F9>
which is as quick as you can get.