Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 5 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .