Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to paste two different lines in two different cases:

In case A, I want to paste "This is case A" and in case B, I want to paste "Completely different case B".

If I use yy and p, only one line could be remembered. Is there a simple way to do such a thing like this:

Just a example:

1) Ctrl+F1+yy copies in buffer F1, Ctrl+F2+yy copies in buffer F2

2) Ctrl+F1+p pastes the line in buffer F1 and Ctrl+F2+p pastes the line in buffer F2
share|improve this question

1 Answer 1

up vote 4 down vote accepted

Vim is perfectly suited for this - it comes with its own set of slots, called registers.

You can access the last, previous-to-last, etc. deleted or yanked contents by prefixing the p paste command with "0, "1, etc.

Alternatively, you can use 26 named registers a - z; explicitly yank / delete into them via "ayy. The :registers command lists the current contents.

Read more at :help registers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.