Tuesday, July 17, 2012

yanking from a different line

Hi All,

Sometimes I prefer to yank a line that I know is at a particular line number without actually moving the cursor to that line.
e.g. if I was at line # 100 in the buffer, and wanted to yank line # 5; I would use:
:5,5y

This would yank line # 5 into the default register.
Is there a better/alternative way to do this?


Also is it possible to "remotely" yank a line into a specific register?
I tried:
:5,5"ay

but it didn't change the contents of register 'a'.

Any suggestions?

- Gautam

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment