how to copy by specifying line numbers in vi

:364,757y should work just fine, but it is probably more common to just do something like 364GV757Gy, allowing the range to be interactively modified when you realize that you really means line 759 or so.


yank those lines in register:

:364,757yEnter

if you want to copy those lines and paste to some certain line, t is your friend. for example:

:364,757t2Enter will copy those lines to under 2nd line.

if you want to copy them to right under your current line:

:364,757t.Enter

Tags:

Vi

Vim