7

Let us suppose that a user maps - to <nop>. How can I, as a script writer, execute a :normal command that correctly uses the default behaviour of -?

8

You have to put ! after :normal like this:

:normal! -

! will make it ignore mappings. From :help :normal:

If the [!] is given, mappings will not be used. Without it, when this command is called from a non-remappable mapping (:noremap), the argument can be mapped anyway.

2
  • Is there a way to ignore a single mapping from normal mode, without needing to go into :normal! ...? Dec 3 '20 at 20:00
  • @EhteshChoudhury Nothing I'm aware of. Searching also didn't find anything. I think it's probably better to open a question. It's likely that any answer will be too involved for the comments anyway. Make sure to explain exactly what you want to do. It will help the people answering the question.
    – tokoyami
    Dec 5 '20 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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