Title: How to copy a specific line in vim from current position?
Tags: vim;editor;vi
Question: How to copy a specific line in vim from current position, without moving to that specific line?
Suppose, in the below code, if my cursor is in line no. 891 and I want to copy a line, say line no. 899. How do I do it without actually moving to the line 899, pressing yy and come back to 891 ?
885 int __pm_runtime_idle(struct device *dev, int rpmflags)
887         unsigned long flags;
888         int retval;
890         might_sleep_if(!(rpmflags &amp; RPM_ASYNC) &amp;&amp; !dev-&gt;power.irq_safe);
892         if (rpmflags &amp; RPM_GET_PUT) {
893                 if (!atomic_dec_and_test(&amp;dev-&gt;power.usage_count))
894                         return 0;
895         }
897         spin_lock_irqsave(&amp;dev-&gt;power.lock, flags);
898         retval = rpm_idle(dev, rpmflags);
899         spin_unlock_irqrestore(&amp;dev-&gt;power.lock, flags);
901         return retval;
Comment: To use that I should count the number of lines to go down. Isn't it too much ?

Comment: Is `8jyy8k` too much?

Comment: Yeah maybe. Jumping to a line number doesn't sound too exciting either. `:899yi` isn't quite as easy to type. Anyway, I don't show line numbers in my vim, so it's even worse for me, but for you may be ok.

Here is the accepted answer: Use the yank command:
This will copy line 899 to the unnamed register.

Here is another answer: My LineJuggler plugin has a fetch mapping that works with relative addressing, which is faster and (especially with :set relativenumber) easier than typing the full line number (as in the other answers).
Your particular example would be 8[f (fetch from 8 lines below the current line).

Here is another answer: this short cmd will help you
:899t.
it will copy the line 899 and paste under your cursor line.
and without touching the " register.

Here is another answer: In general
to yank,
:line#y
to yank &amp; paste in next line
:line#t.
to delete
:line#d
All the above can be applied to a block of lines as well..
to yank from line 10 to line 20
:10,20y

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 4, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:04/01/14', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<vim><editor><vi>', 'Title': 'How to copy a specific line in vim from current position?', 'ViewCount': 694, 'id': 22782173, 'user_AboutMe': '', 'user_AccountId': 4072903.0, 'user_DisplayName': 'Sagar Jain', 'user_Reputation': 7079.0, 'user_Views': 636.0, 'user_id': 3345302.0}}