I have remapped } as follows noremap } }jz. so that as I go down paragraphs the cursor stays in the middle of the screen and to the first line of the next paragraph (usually).

That works fine. But I also use } after y to yank say the next 3 paragraphs to paste elsewhere. For example y3}. In this usage, I want Vim to ignore my mapping. (The rationale is that after a y there is no movement, so my modification to the movement should also be ignored after a y.)

Is there a way to map a movement key, but have a mapping be ignored after y, d, and perhaps even after number prefixes such as 2.

1 Answer 1


Use nnoremap instead of noremap. Mode after pressing y is Operator-pending and that could be addressed by onoremap. You can read more about modes in :h map-modes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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