Detect if a key is bound to something in vim

后端 未结 6 1983
暖寄归人
暖寄归人 2020-12-12 12:33

I\'d like to know if there is a way to figure out if a key does something in vim. I know that I can use :map to see user-defined mappings, but is there somethin

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 13:25

    You can use mapcheck.:-

    For example, I wanted to map ,i to gg=G to indented a file. To check if there is a mapping already for , i

    if mapcheck("\", "I") == "" |echo "no mapping"
    

    ...but this won't detect if the mapping is part of a sequence.

提交回复
热议问题