maralla / completor.vim

Async completion framework made ease.
MIT License
1.32k stars 62 forks source link

Calling ^X completions does not choose the first match #207

Closed jmriego closed 6 years ago

jmriego commented 6 years ago

I started used this plugin not too long ago and I'm loving it so far. Vim is so much more snappy using this than any other completion plugin (async or not) I have tried.

The behavior I'm trying to get is let completor show the popup menu automatically but don't complete until I press . That part so far is the default config.

Then when calling another completion type (such as ) I'd like to make completor choose the first match. That's very similar to the default config vim. In other plugins we need to set some variables but I can't see anything like that in completor. Does anyone know if this is possible? Thanks!

maralla commented 6 years ago

You can use the following config to make the first match to be inserted automatically:

let g:completor_set_options = 0
set completeopt=menuone,preview
jmriego commented 6 years ago

Thanks a lot @maralla, Sorry but that didn't work for me. I don't think I explained this properly. If I set those options the first matching option gets inserted while I type (not when I press for example).

The defaults are almost what I'm trying to do. The only missing part really is that if I enter any type completion (such as , , etc.) instead of just the popup being updated with the new completion mode choices I'd also like to insert the first option.

maralla commented 6 years ago

I pushed a commit to restore the default completeopt after completion done. The latest default action:

I'm not very sure if this is what you want, so let me know if the behaviour is undesirable.

jmriego commented 6 years ago

Thanks a lot, that's exactly what I was trying to get! I honestly didn't expect you to make this change and also to do it so quickly :)