Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Add "minimum completion length" configuration option #375

Open
mrcjkb opened this issue Jun 7, 2021 · 3 comments
Open

Add "minimum completion length" configuration option #375

mrcjkb opened this issue Jun 7, 2021 · 3 comments

Comments

@mrcjkb
Copy link
Contributor

mrcjkb commented Jun 7, 2021

Is your feature request related to a problem? Please describe.
It is usually faster to type a 2-3 letter keyword than it is to select it from an auto-complete list.
For example, with my current configuration, typing in results in the following completion list:

in    | UltiSnips
if    | Keyword
int   | Keyword
InternetDomainName - com.google.common.net | Class
...

Describe the solution you'd like
For me, the if and int completions (and possibly the UltiSnips in snippet) are useless, as it is faster to just type them.
It would be great to be able to configure a minimum length for completion items. Either globally or by source (e.g. so that a different minimum completion length could be set for snippet completions than for LSP completions).

Describe alternatives you've considered
I may look into this myself when I have some time. Here is a good article that describes the problem: https://blog.jetbrains.com/blog/2021/05/28/code-completion-episode-1-scenarios-and-requirements/

@mrcjkb mrcjkb changed the title Add "minimum completion length" option for completion types. Add "minimum completion length" configuration option Jun 7, 2021
@ranjithshegde
Copy link
Contributor

@mrcjkb
Do you mean the minimum amount of characters after which completion should be triggered?
if so, have tried let g:completion_trigger_keyword_length = 3

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Jul 6, 2021

@mrcjkb
Do you mean the minimum amount of characters after which completion should be triggered?
if so, have tried let g:completion_trigger_keyword_length = 3

Yes, thanks for the hint. But I suppose that variable would affect all sources, wouldn't it?
Ideally, I would like to be able to set the minimum amount of characters for different sources, e.g. 2 for UltiSnips and 5 for LSP.

@ranjithshegde
Copy link
Contributor

Hmm, I doubt there is a way to do that yet.
Maybe play around with let g:completion_sorting = "length". I dont know if length sorts ascending or descending, but worth a try?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants