I have a mapping in .vimrc
that conflicts with another mapping in a plugin.
nnoremap <leader>p some fancy command here
When I run VIM, I get a warning:
E227: mapping already exists for ,p
How to overwrite the offending mappings silently?
Edit:
nmap
This might squelch the warning:
:nnoremap <silent> <leader>p some fancy command here
But I suspect the warning isn't actually coming from your mapping. I suspect that the conflicting mapping is defined with <unique>
, and is being mapped after your mapping. <unique>
will issue an E227
if a conflicting map already exists. See :h E227
.
Dig around for a second source of the mapping (plugin, probably) and see if that's the case. Most well-written plugins offer you a way to use your own mappings or overwrite theirs, by setting a global flag to disable mappings entirely, or will detect that you've mapped something else to a specific function (via hasmapto
)
You can see which plugin/script set a mapping via:
:verbose map <leader>p
That should help track down the source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With