The difference is hitting Ctrl+k five times will put all those lines into a buffer. And Ctrl+u will paste those five lines.
In vim, this is complicated. You could do 'y5' requiring to know/calculate the number of lines in advance. But more often then not you are going into visual mode, selecting everything, then y, then p. This is complicated series of distinct commands.
It's a matter of preference, but I personally prefer Ctrl+k/u of nano over the vi/vim method.
Edit: This is the closest behavior I could get to how nano seems to do it:
let @k=""
let @l=""
nnoremap <silent> <C-k> "ldd:let @k=@k.@l \| let @l=@k<cr>
nnoremap <silent> <C-u> :if @l != "" \| let @k=@l \| end<cr>"KgP:let @l=@k<cr>:let @k=""<cr>
The bigger point I'd like to make is that it's a bit silly to complain about vim's default behavior not being as you'd like it. This is the beauty of vim (and emacs): it's a solid foundation upon which to build your ideal workflow. Few people find vim's defaults to be entirely satisfactory, but with a bit of creativity, you can make just about anything happen (and luckily, thanks to many thousands of plugin developers, you can probably find it ready-made).
It isn’t silly nor did it require you to jump to the defense of vim’s behavior.
It was a simple statement that vim’s functionality can be clunky and with all of its flexibility, it cannot handle something as simple as nano/pico’s method for keyboard copy/paste.
It’s literally the one functionality I would love to become available in vim that exists in nano/pico which would make mine (and likely many others’) lives and efficiency better.
But it can handle it with a very small bit of configuration, as I’ve shown above. I am not trying to defend vim here, the editor you use or prefer has no effect on me. I’m just trying to point out that if you want it to work in a certain way, it’s almost always possible.
Ctrl+k is cut line, similar to yy
Ctrl+u is paste, similar to p
The difference is hitting Ctrl+k five times will put all those lines into a buffer. And Ctrl+u will paste those five lines.
In vim, this is complicated. You could do 'y5' requiring to know/calculate the number of lines in advance. But more often then not you are going into visual mode, selecting everything, then y, then p. This is complicated series of distinct commands.
It's a matter of preference, but I personally prefer Ctrl+k/u of nano over the vi/vim method.