简体   繁体   中英

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

I'm writing my first vim plugin. 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.

How can I avoid this problem? Thank you.

use normal! k3yy normal! k3yy with !

from help doc:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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