LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How yank old copied text in VIM? (https://www.linuxquestions.org/questions/linux-newbie-8/how-yank-old-copied-text-in-vim-900731/)

xeon123 09-02-2011 09:25 AM

How yank old copied text in VIM?
 
Hi,

in emacs, it's possible to yank (paste) old text that were copied using several times the key M-y. When we copy text in emacs, it saves it in the buffer. And when we want to yank specific copied text, it goes to the buffer and run through it all.

In a text file, if I do the key sequence just like shown inside <...>, it's possible to paste old text that was saved to the emacs' buffer. For example:

Code:

line1 <M-w>
line2 <M-w>
line3 <M-w>

line3 <C-y>
line2 <C-y M-y>
line1 <C-y M-y M-y>

Is it possible to do the same thing in VIM?

xeon123 09-02-2011 09:34 AM

I found the answer.
In the command ":registers", it contains some of the copied text. To paste is this key sequence, for example:
Code:

"2p
This paste the copied text in the register 2


All times are GMT -5. The time now is 06:03 PM.