简体   繁体   English

为什么禁用映射在我的vim编辑器中不起作用?

[英]Why disabling mapping doesn't work in my vim editor?

In my vim editor, I can find two mappings of through following commands: 在我的vim编辑器中,可以通过以下命令找到的两个映射:

:imap <CR>

and it outputs: 它输出:

i  <CR>        &@<SNR>60_AutoPairsOldCRWrapper73<SNR>60_AutoPairsReturn
i  <CR>          <CR><Plug>DiscretionaryEnd

I want to disable the first one, so I add it into my .vimrc file: 我想禁用第一个,因此将其添加到我的.vimrc文件中:

iunmap <buffer> <CR>

but vim shows error no such mapping error when I open my editor, but actually I can disable the mapping by typing command in editor: 但是当我打开编辑器时,vim显示错误,但no such mapping错误,但是实际上,我可以通过在编辑器中键入命令来禁用映射:

:iunmap <buffer> <CR>

I want to know why I cann't make it work in my .vimrc configuration file. 我想知道为什么不能在我的.vimrc配置文件中使它工作。

Plugins are sourced after your vimrc so the mapping you want to disable is not defined when that comand is executed. 插件来自vimrc因此在执行该命令时未定义要禁用的映射。

That said, the plugin's README tells you how to replace the default mappings. 就是说,插件的README告诉您如何替换默认映射。 So… read it and experiment. 所以……阅读并进行实验。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM