6

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 -?

7

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.

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.