There was a previous bug in vim where if you did a :map after a command that was executed without leaving the ex command then that command will be executed again instead of being mapped. So if you did something like this in vim prior to 9.0.0286 then you will get the error below: The command 'C-R>' is not allowed in autocmd. So any plugin that does something like this may break.
Now that this bug has been fixed in vim you can correct this issue by using the following command. This will prevent the plugin/script you are using from executing the command again if you do it via the :map command.

Update Vim 9.0.0291 and above

:execute 'unmap

Vim 8.0.0286 or higher

Vim 8.0.0286 or higher:
:unmap! C-R>

How to make vim not run a command after completing it

The following command will prevent the plugin/script you are using from executing a command again if you do it via the :map command.
set nocompatible " This removes vim's compatibility mode and prevents plugins from running commands after completion when using the map-commands .
" Execute this command in vim to disable macro loops, etc.
execute 'normal! gg-' . expand('

How to Disable a Key in Vim

To disable a key in vim, you'll need to find out what key the command you want to disable is bound to. Let's say you want to disable the 'C-i' (interactive) command because it's not usable in your current file.
First, open up vim and place your cursor on the colon at the bottom of your screen. In vim type :help

Timeline

Published on: 08/28/2022 12:15:00 UTC
Last modified on: 09/20/2022 20:35:00 UTC

References