When a mapping seems to do nothing or do something totally unexpected, the first reflex to have is to check if it is really mapped to what you want.
To do so the command :map
is your friend:
When using only :map
, Vim will prompt all the mappings created in the current session. To restrict your search to the problematic mapping simply pass the not working keys as argument of the command: here it would be :map p
.
Note that you can use :map <Leader>k
to check what Leaderk is mapped.
It is also good to know that commands like :nmap
, :vmap
, :imap
can be used to search for mapping in particular modes.
Once the :map
commands proved that your mapping is overrided you can easily find which file overrided it: :verbose map <key>
will prompt the last file which modified the mapping.
Finally in some cases it can be useful to know that :mapc
can be used to unmap a key sequence.
[p
and]p
?:nmap p
shows the correct mapping? If it doesn't you can use:verbose nmap p
to see which file overrided your mapping.