How to debug key mappings in vim

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the vim category.

Last Updated: 2024-11-21

I wanted to switch from a regular JavaScript file to my JavaScript test in Vim using the command ':A' as provided by a plugin called alternate_js.

The issue was that this command :A also existed in rails.vim. This took me too long to figure out. What are some better ways in future:

Other times you want to debug some key mapping (e.g. to ensure it's not already taken up). For example, to debug the <tab> key mapping for insert mode, use the command :verbose imap <tab>