How do I duplicate a whole line in Vim in a similar way to Ctrl+D in IntelliJ IDEA/ Resharper or Ctrl+Alt+&
I know I'm late to the party, but whatever; I have this in my .vimrc:
nnoremap :copy .
vnoremap :copy '>
the :copy
command just copies the selected line or the range (always whole lines) to below the line number given as its argument.
In normal mode what this does is copy .
copy this line to just below this line.
And in visual mode it turns into '<,'> copy '>
copy from start of selection to end of selection to the line below end of selection.