ctrlp_bdelete.vim
ctrlp_bdelete.vim copied to clipboard
Support cusom mapping
So I was trying to follow up on one of your todos, by adding support for custom mappings instead of <c-@>
.
if !exists("g:ctrlp_bdelete_map")
let g:ctrlp_bdelete_map = "<c-@>"
end
execute "nnoremap <buffer> <silent> ".g:ctrlp_bdelete_map." :call <sid>DeleteMarkedBuffers()<cr>"
Which ought to work, but seemingly no other combinations than <c-@>
is coming through?
I'm suspecting ctrlp is doing something that might prevent other keys from working, maybe @kien knows whats going on here
I think ctrlp just doesn't let you re-bind keys that are already bound by ctrlp itself. In reality, there are barely any mappings left to use. If you figure something out, let me know :)
I'm actually beginning to consider forking ctrlp, as it appears to either have been abandoned, or something has happened to @kien (I really hope not).
These mappings are left to use: (according to http://tnerual.eriogerg.free.fr/vimqrc.html) ^@ ^K ^_ \ Fn ^Fn
I tested with ^_ and it worked, since ^@ doesn't work for me (something else is triggering)
For posterity:
This plugin applies its mapping before ctrlp applies its own mappings.
So you either have to make sure your key is not in g:ctrlp_prompt_mappings
or replace the mapping.
I have changed the key to <C-x>
so I added let g:ctrlp_prompt_mappings = { 'AcceptSelection("h")': ['<c-cr>', '<c-s>'] }
to my vimrc. (The default for AcceptSelection("h")
includes <C-x>
).