Robert Cussons wrote:
Hi, I think a question like this was posted a long time ago, but I can't remember where or the answer, so please excuse me for asking it again.
If I yank the next word with yw the cursor stays where it is.
However if I want to yank text backwards from my current position for example to get the last word I use yb and the cursor moves to the beginning of the word. As I thought these two motion commands were the inverse and they appear to operate like that, why the difference in their reaction under the y operator?

Thanks
Rob.


The answer doesn't have a help tag, but it is somewhere under the description of the yank command in change.txt:

<quote>
Note that after a characterwise yank command, Vim leaves the cursor on the
first yanked character that is closest to the start of the buffer.  This means
that "yl" doesn't move the cursor, but "yh" moves the cursor one character
left.
Rationale:      In Vi the "y" command followed by a backwards motion would
                sometimes not move the cursor to the first yanked character,
                because redisplaying was skipped.  In Vim it always moves to
                the first character, as specified by Posix.
With a linewise yank command the cursor is put in the first line, but the
column is unmodified, thus it may not be on the first yanked character.
</quote>


Best regards,
Tony.
--
"I'd love to go out with you, but I did my own thing and now I've got
to undo it."

Reply via email to