How to find out in Vim which command is triggered by some shortcut

隐身守侯 提交于 2019-12-09 06:36:24

问题


I try to execute a command in some plugin by pushing it's keyboard shortcut F2. But some other command is executed, instead. But that command gives an error. So it is not clear where the key mapping of that interfering command is defined. I want to change the mapping of that shortcut. To do this I need to find out what that interfering command is.

Is there a way to find out which command is triggered by some keyboard shortcut?


回答1:


verbose map <F2>

will give you information about both {rhs} and place where this mapping was defined. For insert mode mappings replace map with imap, same for other mapping modes.




回答2:


You can check the shortcuts in ~/.vimrc file and ~/.vim/plugin/[you plugin name], maybe you find which action is bound to the F2 key.



来源:https://stackoverflow.com/questions/4218035/how-to-find-out-in-vim-which-command-is-triggered-by-some-shortcut

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!