简体   繁体   English

编写vim插件时,如何准备用户的自定义映射?

[英]When writing a vim plugin, how to be prepared for the user's custom mappings?

I'm writing my first vim plugin. 我正在写我的第一个vim插件。 In the code I keep using stuff like execute 'normal k3yy' but, there is a possibility that the person using the plugin mapped different behaviour to the k and yy keys for instance, which can lead my plugin to perform in a unexpected way. 在代码中,我继续使用诸如execute 'normal k3yy'类的东西,但是,使用该插件的人可能execute 'normal k3yy'不同的行为映射到例如kyy键,这可能导致我的插件以意外的方式执行。

How can I avoid this problem? 如何避免这个问题? Thank you. 谢谢。

use normal! k3yy 使用normal! k3yy normal! k3yy with ! normal! k3yy!

from help doc: 来自帮助文档:

If the [!] is given, mappings will not be used.

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

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