vim-ctrlp-cmdpalette icon indicating copy to clipboard operation
vim-ctrlp-cmdpalette copied to clipboard

Hit <CR> once to execute?

Open kshenoy opened this issue 11 years ago • 3 comments

Hi, thank you for a really good plugin. I didn't think I needed it till I used it. Now it's almost indispensable.

I had a quick question about the behavior. When I execute :CtrlPCmdPalette<CR>, I type in my command and then I have to press <CR> twice to execute the command. This is a little different from opening files etc. where only a single <CR> is required. Is this behavior defined by this plugin or CtrlP itself?

Also, I understand that sometimes you wouldn't want to execute the command directly but maybe pass in some arguments etc. thus it makes sense to just put it on the command-line after pressing <CR>. However, is there a way I can define these mappings such that pressing <Tab> in the CtrlP window puts it on the command-line while pressing <CR> executes it?

kshenoy avatar Sep 14 '14 16:09 kshenoy

Sadly, CtrlP's extension API doesn't allow too much customization for the "choosing" of results. It only allows 4 modes of choosing, with <cr>, <c-t>, <c-v> or <c-x>, and each one has a special meaning.

That's why I used double to execute, and a single <cr> to just prepend and expect for extra arguments, as both seemed easier than something like control+key for one of the cases and for the other. Tab would be a nice one, but isn's supported in the extension API.

fisadev avatar Sep 16 '14 17:09 fisadev

Ah, that sucks.

However, if you don't mind, could you elaborate on what exactly you'd need so that I can request the same here. This is supposed to be a fork that is active in accepting pull requests.

kshenoy avatar Sep 16 '14 20:09 kshenoy

If possible, it would be nice to be able to "accept" the selected result with other extension-defined keys (defined by each extension separatedly). Example: an extension could be able to use TAB and CR as a keys to accept the selected result, with different behaviour for each key.

fisadev avatar Sep 17 '14 13:09 fisadev