Let's say I have the text:
foo bar baz
With the cursor on z
, I would expect :normal! lb
to move the cursor to the first letter of baz
. In actual fact the cursor does not move.
However typing :normal! l
and then :normal! b
does move the cursor as expected.
The docs for :normal!
state:
Execution stops when an error is encountered.
Is this why :normal! lb
doesn't do what I expect? The l
cannot move to the right and so it is treated as a (silent) error?
Thanks in advance!
l
erroring and canceling the question is the reason.l
would be a no-op but evidently not.norm! l
produces an error when it is on the last character of a line: you ask Vim to move the cursor to the right, by default l can't change line so Vim tries to move the cursor and can't do it so it is an error.