Mert Nuhoglu
Mert Nuhoglu

Reputation: 10153

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

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?

Upvotes: 11

Views: 2078

Answers (2)

Cosmin Cojocar
Cosmin Cojocar

Reputation: 745

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.

Upvotes: 0

ZyX
ZyX

Reputation: 53674

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.

Upvotes: 24

Related Questions