ctrlp_bdelete.vim icon indicating copy to clipboard operation
ctrlp_bdelete.vim copied to clipboard

Support cusom mapping

Open torgeir opened this issue 9 years ago • 3 comments

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

torgeir avatar Jul 17 '14 21:07 torgeir

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).

d11wtq avatar Jul 22 '14 11:07 d11wtq

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)

johgh avatar Feb 22 '15 22:02 johgh

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>).

jandamm avatar Jun 26 '20 19:06 jandamm