I was messing with the expression register (
:h @=) and noticed that it is not possible to put text directly in it. The doc says:
The expression register is read-only; you cannot put text into it.
Let's say my buffer contains an operation like that:
If I want to get the result in the expression register, I have to do the following:
- yf4: Put the expression into the unnamed register
- "=: Start editing the expression register
- Ctrl-r"enter: Put the content of the unnamed register into the expression register
If the expression register weren't read only I could have done it more easily:
- "=yf4 Select the expression register and put the line into it.
So my question is not about how I could change this behavior but what can explain this implementation?
Is it because yanking directly into the expression register would be "against the Vim way"? Is it because of a technical limitation? Is there another reason?
According to the comments, the states of the expression register has changed recently:
But @romainl and @lcd047 told me that the doc says the register is read-write. So I looked up the list of the patches but didn't find one about this change... I have to admit that I'm pretty confused by the situation now.